Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1397)

Side by Side Diff: build/common.gypi

Issue 691783003: [WIP NOT FOR COMMIT] Switch Android to libc++ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # IMPORTANT: 5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium, 6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion. 7 # since gyp_chromium is automatically forcing its inclusion.
8 { 8 {
9 # Variables expected to be overriden on the GYP command line (-D) or by 9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi. 10 # ~/.gyp/include.gypi.
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 'android_host_arch%': '<!(uname -m)', 1660 'android_host_arch%': '<!(uname -m)',
1661 # Android API-level of the SDK used for compilation. 1661 # Android API-level of the SDK used for compilation.
1662 'android_sdk_version%': '21', 1662 'android_sdk_version%': '21',
1663 'android_sdk_build_tools_version%': '21.0.1', 1663 'android_sdk_build_tools_version%': '21.0.1',
1664 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')", 1664 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
1665 }, 1665 },
1666 # Copy conditionally-set variables out one scope. 1666 # Copy conditionally-set variables out one scope.
1667 'android_ndk_root%': '<(android_ndk_root)', 1667 'android_ndk_root%': '<(android_ndk_root)',
1668 'android_sdk_root%': '<(android_sdk_root)', 1668 'android_sdk_root%': '<(android_sdk_root)',
1669 'android_sdk_version%': '<(android_sdk_version)', 1669 'android_sdk_version%': '<(android_sdk_version)',
1670 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport', 1670 'android_libc++_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc+ +',
1671 'host_os%': '<(host_os)', 1671 'host_os%': '<(host_os)',
1672 1672
1673 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_v ersion)', 1673 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_v ersion)',
1674 # Android SDK build tools (e.g. dx, aapt, aidl) 1674 # Android SDK build tools (e.g. dx, aapt, aidl)
1675 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_b uild_tools_version)', 1675 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_b uild_tools_version)',
1676 1676
1677 # Android API level 14 is ICS (Android 4.0) which is the minimum 1677 # Android API level 14 is ICS (Android 4.0) which is the minimum
1678 # platform requirement for Chrome on Android, we use it for native 1678 # platform requirement for Chrome on Android, we use it for native
1679 # code compilation. 1679 # code compilation.
1680 'conditions': [ 1680 'conditions': [
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 'android_sdk_root%': '<(android_sdk_root)', 1737 'android_sdk_root%': '<(android_sdk_root)',
1738 'android_sdk_version%': '<(android_sdk_version)', 1738 'android_sdk_version%': '<(android_sdk_version)',
1739 'android_toolchain%': '<(android_toolchain)', 1739 'android_toolchain%': '<(android_toolchain)',
1740 1740
1741 'android_ndk_include': '<(android_ndk_sysroot)/usr/include', 1741 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
1742 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)', 1742 'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
1743 'android_sdk_tools%': '<(android_sdk_tools)', 1743 'android_sdk_tools%': '<(android_sdk_tools)',
1744 'android_sdk%': '<(android_sdk)', 1744 'android_sdk%': '<(android_sdk)',
1745 'android_sdk_jar%': '<(android_sdk)/android.jar', 1745 'android_sdk_jar%': '<(android_sdk)/android.jar',
1746 1746
1747 'android_stlport_root': '<(android_stlport_root)', 1747 'android_libc++_root': '<(android_libc++_root)',
1748 'android_stlport_include': '<(android_stlport_root)/stlport', 1748 'android_libc++_include': '<(android_libc++_root)/libcxx/include',
1749 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_ abi)', 1749 'android_libc++_libs_dir': '<(android_libc++_root)/libs/<(android_app_ab i)',
1750
1750 'host_os%': '<(host_os)', 1751 'host_os%': '<(host_os)',
1751 1752
1752 # Location of the "objcopy" binary, used by both gyp and scripts. 1753 # Location of the "objcopy" binary, used by both gyp and scripts.
1753 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)', 1754 'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
1754 1755
1755 # Location of the "strip" binary, used by both gyp and scripts. 1756 # Location of the "strip" binary, used by both gyp and scripts.
1756 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)', 1757 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
1757 1758
1758 # Location of the "readelf" binary. 1759 # Location of the "readelf" binary.
1759 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)', 1760 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
3519 '--param=ssp-buffer-size=4', 3520 '--param=ssp-buffer-size=4',
3520 ], 3521 ],
3521 }, 3522 },
3522 }], 3523 }],
3523 ['os_posix==1 and OS!="mac" and OS!="ios"', { 3524 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3524 'target_defaults': { 3525 'target_defaults': {
3525 # Enable -Werror by default, but put it in a variable so it can 3526 # Enable -Werror by default, but put it in a variable so it can
3526 # be disabled in ~/.gyp/include.gypi on the valgrind builders. 3527 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3527 'variables': { 3528 'variables': {
3528 'werror%': '-Werror', 3529 'werror%': '-Werror',
3530 #'werror%': '',
3529 'libraries_for_target%': '', 3531 'libraries_for_target%': '',
3530 }, 3532 },
3531 'defines': [ 3533 'defines': [
3532 '_FILE_OFFSET_BITS=64', 3534 '_FILE_OFFSET_BITS=64',
3533 ], 3535 ],
3534 'cflags': [ 3536 'cflags': [
3535 '<(werror)', # See note above about the werror variable. 3537 '<(werror)', # See note above about the werror variable.
3536 '-pthread', 3538 '-pthread',
3537 '-fno-strict-aliasing', # See http://crbug.com/32204 3539 '-fno-strict-aliasing', # See http://crbug.com/32204
3538 '-Wall', 3540 '-Wall',
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
3894 '-fno-tree-sra', 3896 '-fno-tree-sra',
3895 # The following option is disabled to improve binary 3897 # The following option is disabled to improve binary
3896 # size and performance in gcc 4.9. 3898 # size and performance in gcc 4.9.
3897 '-fno-caller-saves', 3899 '-fno-caller-saves',
3898 '-Wno-psabi', 3900 '-Wno-psabi',
3899 ], 3901 ],
3900 # Android now supports .relro sections properly. 3902 # Android now supports .relro sections properly.
3901 # NOTE: While these flags enable the generation of .relro 3903 # NOTE: While these flags enable the generation of .relro
3902 # sections, the generated libraries can still be loaded on 3904 # sections, the generated libraries can still be loaded on
3903 # older Android platform versions. 3905 # older Android platform versions.
3906 'cflags_cc': [
3907 '-std=gnu++11',
3908 ],
3904 'ldflags': [ 3909 'ldflags': [
3905 '-Wl,-z,relro', 3910 '-Wl,-z,relro',
3906 '-Wl,-z,now', 3911 '-Wl,-z,now',
3907 '-fuse-ld=gold', 3912 '-fuse-ld=gold',
3908 ], 3913 ],
3909 'conditions': [ 3914 'conditions': [
3910 ['gcc_version==48 and clang==0', { 3915 ['gcc_version==48 and clang==0', {
3911 'cflags': [ 3916 'cflags': [
3912 # The following 5 options are disabled to save on 3917 # The following 5 options are disabled to save on
3913 # binary size in GCC 4.8. 3918 # binary size in GCC 4.8.
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
4448 ['OS=="android"', { 4453 ['OS=="android"', {
4449 'variables': { 4454 'variables': {
4450 # This is a unique identifier for a given build. It's used for 4455 # This is a unique identifier for a given build. It's used for
4451 # identifying various build artifacts corresponding to a particular 4456 # identifying various build artifacts corresponding to a particular
4452 # build of chrome (e.g. where to find archived symbols). 4457 # build of chrome (e.g. where to find archived symbols).
4453 'chrome_build_id%': '', 4458 'chrome_build_id%': '',
4454 'conditions': [ 4459 'conditions': [
4455 # Figure this out early since it needs symbols from libgcc.a, so it 4460 # Figure this out early since it needs symbols from libgcc.a, so it
4456 # has to be before that in the set of libraries. 4461 # has to be before that in the set of libraries.
4457 ['component=="shared_library"', { 4462 ['component=="shared_library"', {
4458 'android_stlport_library': 'stlport_shared', 4463 'android_libc++_library': 'c++_shared',
4459 }, { 4464 }, {
4460 'android_stlport_library': 'stlport_static', 4465 'android_libc++_library': 'c++_static',
4461 }], 4466 }],
4462 ], 4467 ],
4463 4468
4464 # Placing this variable here prevents from forking libvpx, used 4469 # Placing this variable here prevents from forking libvpx, used
4465 # by remoting. Remoting is off, so it needn't built, 4470 # by remoting. Remoting is off, so it needn't built,
4466 # so forking it's deps seems like overkill. 4471 # so forking it's deps seems like overkill.
4467 # But this variable need defined to properly run gyp. 4472 # But this variable need defined to properly run gyp.
4468 # A proper solution is to have an OS==android conditional 4473 # A proper solution is to have an OS==android conditional
4469 # in third_party/libvpx/libvpx.gyp to define it. 4474 # in third_party/libvpx/libvpx.gyp to define it.
4470 'libvpx_path': 'lib/linux/arm', 4475 'libvpx_path': 'lib/linux/arm',
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
4534 '-g', 4539 '-g',
4535 '-fstack-protector', 4540 '-fstack-protector',
4536 '-fno-short-enums', 4541 '-fno-short-enums',
4537 '-finline-limit=64', 4542 '-finline-limit=64',
4538 '-Wa,--noexecstack', 4543 '-Wa,--noexecstack',
4539 '<@(release_extra_cflags)', 4544 '<@(release_extra_cflags)',
4540 ], 4545 ],
4541 'defines': [ 4546 'defines': [
4542 'ANDROID', 4547 'ANDROID',
4543 '__GNU_SOURCE=1', # Necessary for clone() 4548 '__GNU_SOURCE=1', # Necessary for clone()
4544 'USE_STLPORT=1',
4545 '_STLP_USE_PTR_SPECIALIZATIONS=1',
4546 'CHROME_BUILD_ID="<(chrome_build_id)"', 4549 'CHROME_BUILD_ID="<(chrome_build_id)"',
4547 ], 4550 ],
4548 'ldflags!': [ 4551 'ldflags!': [
4549 '-pthread', # Not supported by Android toolchain. 4552 '-pthread', # Not supported by Android toolchain.
4550 ], 4553 ],
4551 'ldflags': [ 4554 'ldflags': [
4552 '-Wl,--no-undefined', 4555 '-Wl,--no-undefined',
4553 ], 4556 ],
4554 'conditions': [ 4557 'conditions': [
4555 ['component=="static_library"', { 4558 ['component=="static_library"', {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
4619 'HAVE_SYS_UIO_H', 4622 'HAVE_SYS_UIO_H',
4620 ], 4623 ],
4621 'cflags': [ 4624 'cflags': [
4622 '--sysroot=<(android_ndk_sysroot)', 4625 '--sysroot=<(android_ndk_sysroot)',
4623 ], 4626 ],
4624 'ldflags': [ 4627 'ldflags': [
4625 '--sysroot=<(android_ndk_sysroot)', 4628 '--sysroot=<(android_ndk_sysroot)',
4626 '-nostdlib', 4629 '-nostdlib',
4627 ], 4630 ],
4628 'libraries': [ 4631 'libraries': [
4629 '-l<(android_stlport_library)', 4632 '-l<(android_libc++_library)',
4630 # Manually link the libgcc.a that the cross compiler uses. 4633 '-latomic',
4631 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', 4634 '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
4635 '-lm',
4632 '-lc', 4636 '-lc',
4633 '-ldl', 4637 '-ldl',
4634 '-lm',
4635 ], 4638 ],
4636 }], 4639 }],
4637 ['android_webview_build==1', { 4640 ['android_webview_build==1', {
4638 'cflags': [ 4641 'cflags': [
4639 # Android predefines this as 1; undefine it here so Chromium 4642 # Android predefines this as 1; undefine it here so Chromium
4640 # can redefine it later to be 2 for chromium code and unset 4643 # can redefine it later to be 2 for chromium code and unset
4641 # for third party code. This works because cflags are added 4644 # for third party code. This works because cflags are added
4642 # before defines. 4645 # before defines.
4643 '-U_FORTIFY_SOURCE', 4646 '-U_FORTIFY_SOURCE',
4644 # Disable any additional warnings enabled by the Android build system but which 4647 # Disable any additional warnings enabled by the Android build system but which
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4676 ], 4679 ],
4677 }], 4680 }],
4678 ], 4681 ],
4679 }], 4682 }],
4680 ['target_arch == "arm"', { 4683 ['target_arch == "arm"', {
4681 'ldflags': [ 4684 'ldflags': [
4682 # Enable identical code folding to reduce size. 4685 # Enable identical code folding to reduce size.
4683 '-Wl,--icf=safe', 4686 '-Wl,--icf=safe',
4684 ], 4687 ],
4685 }], 4688 }],
4686 # NOTE: The stlport header include paths below are specified in 4689 # TODO: delete this?
4690 # NOTE: The libc++ header include paths below are specified in
4687 # cflags rather than include_dirs because they need to come 4691 # cflags rather than include_dirs because they need to come
4688 # after include_dirs. Think of them like system headers, but 4692 # after include_dirs. Think of them like system headers, but
4689 # don't use '-isystem' because the arm-linux-androideabi-4.4.3 4693 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
4690 # toolchain (circa Gingerbread) will exhibit strange errors. 4694 # toolchain (circa Gingerbread) will exhibit strange errors.
4691 # The include ordering here is important; change with caution. 4695 # The include ordering here is important; change with caution.
4692 ['android_webview_build==0', { 4696 ['android_webview_build==0', {
4693 'cflags': [ 4697 'cflags': [
4694 '-isystem<(android_stlport_include)', 4698 '-isystem<(android_libc++_include)',
4699 '-I<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxab i/include',
4700 '-I<(android_ndk_root)/sources/android/support/include',
4695 ], 4701 ],
4696 'ldflags': [ 4702 'ldflags': [
4697 '-L<(android_stlport_libs_dir)', 4703 '-L<(android_libc++_libs_dir)',
4698 ], 4704 ],
4699 }, { # else: android_webview_build!=0 4705 }, { # else: android_webview_build!=0
4700 'aosp_build_settings': { 4706 'aosp_build_settings': {
4701 # Specify that we want to statically link stlport from the 4707 # Specify that we want to statically link stlport from the
4702 # NDK. This will provide all the include and library paths 4708 # NDK. This will provide all the include and library paths
4703 # automatically at build time, and link the right library. 4709 # automatically at build time, and link the right library.
4704 'LOCAL_NDK_STL_VARIANT': 'stlport_static', 4710 'LOCAL_NDK_STL_VARIANT': 'libc++_static',
4705 }, 4711 },
4706 }], 4712 }],
4707 ['target_arch=="ia32"', { 4713 ['target_arch=="ia32"', {
4708 # The x86 toolchain currently has problems with stack-protector. 4714 # The x86 toolchain currently has problems with stack-protector.
4709 'cflags!': [ 4715 'cflags!': [
4710 '-fstack-protector', 4716 '-fstack-protector',
4711 ], 4717 ],
4712 'cflags': [ 4718 'cflags': [
4713 '-fno-stack-protector', 4719 '-fno-stack-protector',
4714 ], 4720 ],
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
5878 # settings in target dicts. SYMROOT is a special case, because many other 5884 # settings in target dicts. SYMROOT is a special case, because many other
5879 # Xcode variables depend on it, including variables such as 5885 # Xcode variables depend on it, including variables such as
5880 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 5886 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5881 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 5887 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5882 # files to appear (when present) in the UI as actual files and not red 5888 # files to appear (when present) in the UI as actual files and not red
5883 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 5889 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5884 # and therefore SYMROOT, needs to be set at the project level. 5890 # and therefore SYMROOT, needs to be set at the project level.
5885 'SYMROOT': '<(DEPTH)/xcodebuild', 5891 'SYMROOT': '<(DEPTH)/xcodebuild',
5886 }, 5892 },
5887 } 5893 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698