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

Side by Side Diff: build/common.gypi

Issue 197283006: Update common.gypi to set clang=1 for all iOS builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 # is some third party code that takes a long time to fix/roll. So, this 1092 # is some third party code that takes a long time to fix/roll. So, this
1093 # flag allows us to have warnings as errors in general to prevent 1093 # flag allows us to have warnings as errors in general to prevent
1094 # regressions in most modules, while working on the bits that are 1094 # regressions in most modules, while working on the bits that are
1095 # remaining. 1095 # remaining.
1096 'win_third_party_warn_as_error%': 'true', 1096 'win_third_party_warn_as_error%': 'true',
1097 1097
1098 # Clang stuff. 1098 # Clang stuff.
1099 'clang%': '<(clang)', 1099 'clang%': '<(clang)',
1100 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts', 1100 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
1101 1101
1102 # Control which version of clang to use when 'clang' is set to 1 when 1102 # Control which version of clang to use when building for iOS. If set to
1103 # building for iOS (Apple has not yet open-sourced support for "arm64" 1103 # '1', uses the version of clang that ships with Xcode. If set to '0', uses
1104 # so when building for that 'target_arch' we have to use clang shipped 1104 # the version of clang that ships with the Chromium source. This variable
1105 # with Xcode that does not supports some flags). 1105 # is automatically set to '1' when using the Xcode generator.
1106 # TODO(sdefresne): remove this once http://crbug.com/341453 is fixed.
1107 'clang_xcode%': 0, 1106 'clang_xcode%': 0,
1108 1107
1109 # These two variables can be set in GYP_DEFINES while running 1108 # These two variables can be set in GYP_DEFINES while running
1110 # |gclient runhooks| to let clang run a plugin in every compilation. 1109 # |gclient runhooks| to let clang run a plugin in every compilation.
1111 # Only has an effect if 'clang=1' is in GYP_DEFINES as well. 1110 # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
1112 # Example: 1111 # Example:
1113 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dyl ib clang_add_plugin=print-fns' gclient runhooks 1112 # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dyl ib clang_add_plugin=print-fns' gclient runhooks
1114 1113
1115 'clang_load%': '', 1114 'clang_load%': '',
1116 'clang_add_plugin%': '', 1115 'clang_add_plugin%': '',
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 1515
1517 # Copy it out one scope. 1516 # Copy it out one scope.
1518 'android_webview_build%': '<(android_webview_build)', 1517 'android_webview_build%': '<(android_webview_build)',
1519 }], # OS=="android" 1518 }], # OS=="android"
1520 ['android_webview_build==1', { 1519 ['android_webview_build==1', {
1521 # When building the WebView in the Android tree, jarjar will remap all 1520 # When building the WebView in the Android tree, jarjar will remap all
1522 # the class names, so the JNI generator needs to know this. 1521 # the class names, so the JNI generator needs to know this.
1523 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt' , 1522 'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt' ,
1524 }], 1523 }],
1525 ['OS=="mac"', { 1524 ['OS=="mac"', {
1526 # Enable clang on mac by default!
1527 'clang%': 1,
1528 'conditions': [ 1525 'conditions': [
1529 # All Chrome builds have breakpad symbols, but only process the 1526 # All Chrome builds have breakpad symbols, but only process the
1530 # symbols from official builds. 1527 # symbols from official builds.
1531 ['(branding=="Chrome" and buildtype=="Official")', { 1528 ['(branding=="Chrome" and buildtype=="Official")', {
1532 'mac_strip_release%': 1, 1529 'mac_strip_release%': 1,
1533 }], 1530 }],
1534 ], 1531 ],
1535 }], # OS=="mac" 1532 }], # OS=="mac"
1536 ['OS=="mac" or OS=="ios"', { 1533 ['OS=="mac" or OS=="ios"', {
1534 # Enable clang on mac by default! All iOS builds already use clang.
Nico 2014/03/13 15:43:38 nit: This comment can probably go away. It was (ma
1535 'clang%': 1,
1536
1537 'variables': { 1537 'variables': {
1538 # Mac OS X SDK and deployment target support. The SDK identifies 1538 # Mac OS X SDK and deployment target support. The SDK identifies
1539 # the version of the system headers that will be used, and 1539 # the version of the system headers that will be used, and
1540 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time 1540 # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
1541 # macro. "Maximum allowed" refers to the operating system version 1541 # macro. "Maximum allowed" refers to the operating system version
1542 # whose APIs are available in the headers. The deployment target 1542 # whose APIs are available in the headers. The deployment target
1543 # identifies the minimum system version that the built products are 1543 # identifies the minimum system version that the built products are
1544 # expected to function on. It corresponds to the 1544 # expected to function on. It corresponds to the
1545 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these 1545 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these
1546 # macros are available, #include <AvailabilityMacros.h>. Additional 1546 # macros are available, #include <AvailabilityMacros.h>. Additional
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 ['OS=="mac" or OS=="ios"', { 1745 ['OS=="mac" or OS=="ios"', {
1746 'grit_defines': ['-D', 'scale_factors=2x'], 1746 'grit_defines': ['-D', 'scale_factors=2x'],
1747 }], 1747 }],
1748 ['OS == "ios"', { 1748 ['OS == "ios"', {
1749 'grit_defines': [ 1749 'grit_defines': [
1750 '-t', 'ios', 1750 '-t', 'ios',
1751 # iOS uses a whitelist to filter resources. 1751 # iOS uses a whitelist to filter resources.
1752 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt' 1752 '-w', '<(DEPTH)/build/ios/grit_whitelist.txt'
1753 ], 1753 ],
1754 1754
1755 # Enable clang and host builds when generating with ninja-ios. 1755 # Enable host builds when generating with ninja-ios.
1756 'conditions': [ 1756 'conditions': [
1757 ['"<(GENERATOR)"=="ninja"', { 1757 ['"<(GENERATOR)"=="ninja"', {
1758 'clang%': 1,
1759 'host_os%': "mac", 1758 'host_os%': "mac",
1760 }], 1759 }],
1761 # Apple has not upstreamed the support for "arm64" yet, so when 1760
1762 # building for "arm64" or "both", we need to use the clang that 1761 # TODO(sdefresne): Remove the target_subarch check once Apple has
1763 # is provided with Xcode. 1762 # upstreamed the support for "arm64". http://crbug.com/341453
1764 ['target_subarch!="arm32"', { 1763 ['target_subarch!="arm32" or "<(GENERATOR)"=="xcode"', {
1765 'clang_xcode%': 1, 1764 'clang_xcode%': 1,
1766 }], 1765 }],
1767 ], 1766 ],
1768 }], 1767 }],
1769 ['enable_extensions==1', { 1768 ['enable_extensions==1', {
1770 'grit_defines': ['-D', 'enable_extensions'], 1769 'grit_defines': ['-D', 'enable_extensions'],
1771 }], 1770 }],
1772 ['enable_plugins!=0', { 1771 ['enable_plugins!=0', {
1773 'grit_defines': ['-D', 'enable_plugins'], 1772 'grit_defines': ['-D', 'enable_plugins'],
1774 }], 1773 }],
(...skipping 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after
4129 # which we no longer use. Check if it makes sense to remove 4128 # which we no longer use. Check if it makes sense to remove
4130 # this as well. http://crbug.com/316352 4129 # this as well. http://crbug.com/316352
4131 '-Wno-unneeded-internal-declaration', 4130 '-Wno-unneeded-internal-declaration',
4132 4131
4133 # Warns on switches on enums that cover all enum values but 4132 # Warns on switches on enums that cover all enum values but
4134 # also contain a default: branch. Chrome is full of that. 4133 # also contain a default: branch. Chrome is full of that.
4135 '-Wno-covered-switch-default', 4134 '-Wno-covered-switch-default',
4136 4135
4137 # Warns when a const char[] is converted to bool. 4136 # Warns when a const char[] is converted to bool.
4138 '-Wstring-conversion', 4137 '-Wstring-conversion',
4138
4139 # Clang considers the `register` keyword as deprecated, but
4140 # e.g. code generated by flex (used in angle) contains that
4141 # keyword. http://crbug.com/255186
4142 '-Wno-deprecated-register',
4139 ], 4143 ],
4140 4144
4141 'conditions': [ 4145 'conditions': [
4142 ['clang_xcode==0', { 4146 ['clang_xcode==0', {
4143 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang', 4147 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
4144 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++', 4148 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
4145
4146 'WARNING_CFLAGS': [
4147 # Clang considers the `register` keyword as deprecated, but
4148 # e.g. code generated by flex (used in angle) contains that
4149 # keyword. http://crbug.com/255186
4150 #
4151 # Note: clang as shipped with Xcode is older and does not
4152 # treat the `register` as deprecated and does not define
4153 # this flag, so don't enable it if "clang_xcode" is "1".
4154 '-Wno-deprecated-register',
4155 ],
4156 }], 4149 }],
4157 ], 4150 ],
4158 }], 4151 }],
4159 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', { 4152 ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
4160 'OTHER_CFLAGS': [ 4153 'OTHER_CFLAGS': [
4161 '<@(clang_chrome_plugins_flags)', 4154 '<@(clang_chrome_plugins_flags)',
4162 ], 4155 ],
4163 }], 4156 }],
4164 ['clang==1 and clang_xcode==0 and clang_load!=""', { 4157 ['clang==1 and clang_xcode==0 and clang_load!=""', {
4165 'OTHER_CFLAGS': [ 4158 'OTHER_CFLAGS': [
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 }], # mac_real_dsym 4412 }], # mac_real_dsym
4420 ], # target_conditions 4413 ], # target_conditions
4421 }], # (_type=="executable" or _type=="shared_library" or 4414 }], # (_type=="executable" or _type=="shared_library" or
4422 # _type=="loadable_module") and mac_strip!=0 4415 # _type=="loadable_module") and mac_strip!=0
4423 ], # target_conditions 4416 ], # target_conditions
4424 }, # target_defaults 4417 }, # target_defaults
4425 }], # OS=="mac" 4418 }], # OS=="mac"
4426 ['OS=="ios"', { 4419 ['OS=="ios"', {
4427 'target_defaults': { 4420 'target_defaults': {
4428 'xcode_settings' : { 4421 'xcode_settings' : {
4429 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
4430
4431 # This next block is mostly common with the 'mac' section above,
4432 # but keying off (or setting) 'clang' isn't valid for iOS as it
4433 # also means using Chromium's build of clang.
4434
4435 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang 4422 # TODO(stuartmorgan): switch to c++0x (see TODOs in the clang
4436 # section above). 4423 # section above).
4437 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', 4424 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',
4438 # Warn if automatic synthesis is triggered with
4439 # the -Wobjc-missing-property-synthesis flag.
4440 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
4441 'WARNING_CFLAGS': [
4442 '-Wheader-hygiene',
4443 # Don't die on dtoa code that uses a char as an array index.
4444 # This is required solely for base/third_party/dmg_fp/dtoa.cc.
4445 '-Wno-char-subscripts',
4446 # See comment in the mac clang section above for this flag.
4447 '-Wno-unneeded-internal-declaration',
4448 # Match OS X clang C++11 warning settings.
4449 '-Wno-c++11-narrowing',
4450 # As of Xcode 5.1, the register keyword is deprecated, but Chromium
4451 # code still uses it.
4452 '-Wno-deprecated-register',
4453 ],
4454 4425
4455 'conditions': [ 4426 'conditions': [
4456 # Older Xcodes do not support -Wno-deprecated-register, so pass an 4427 # Older Xcodes do not support -Wno-deprecated-register, so pass an
4457 # additional flag to suppress the "unknown compiler option" error. 4428 # additional flag to suppress the "unknown compiler option" error.
4458 # Restrict this flag to builds that are either compiling with Xcode 4429 # Restrict this flag to builds that are either compiling with Xcode
4459 # or compiling with Xcode's Clang. This will allow Ninja builds to 4430 # or compiling with Xcode's Clang. This will allow Ninja builds to
4460 # continue failing on unknown compiler options. 4431 # continue failing on unknown compiler options.
4461 # TODO(rohitrao): This flag is temporary and should be removed as 4432 # TODO(rohitrao): This flag is temporary and should be removed as
4462 # soon as the iOS bots are updated to use Xcode 5.1. 4433 # soon as the iOS bots are updated to use Xcode 5.1.
4463 ['"<(GENERATOR)"=="xcode" or clang_xcode==1', { 4434 ['clang_xcode==1', {
4464 'WARNING_CFLAGS': [ 4435 'WARNING_CFLAGS': [
4465 '-Wno-unknown-warning-option', 4436 '-Wno-unknown-warning-option',
4466 ], 4437 ],
4467 }], 4438 }],
4468 4439
4469 # Limit the valid architectures depending on "target_subarch". 4440 # Limit the valid architectures depending on "target_subarch".
4470 # This need to include the "arm" architectures but also the "x86" 4441 # This need to include the "arm" architectures but also the "x86"
4471 # ones (they are used when building for the simulator). 4442 # ones (they are used when building for the simulator).
4472 ['target_subarch=="arm32"', { 4443 ['target_subarch=="arm32"', {
4473 'VALID_ARCHS': ['armv7', 'i386'], 4444 'VALID_ARCHS': ['armv7', 'i386'],
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
5052 # settings in target dicts. SYMROOT is a special case, because many other 5023 # settings in target dicts. SYMROOT is a special case, because many other
5053 # Xcode variables depend on it, including variables such as 5024 # Xcode variables depend on it, including variables such as
5054 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 5025 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5055 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 5026 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5056 # files to appear (when present) in the UI as actual files and not red 5027 # files to appear (when present) in the UI as actual files and not red
5057 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 5028 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5058 # and therefore SYMROOT, needs to be set at the project level. 5029 # and therefore SYMROOT, needs to be set at the project level.
5059 'SYMROOT': '<(DEPTH)/xcodebuild', 5030 'SYMROOT': '<(DEPTH)/xcodebuild',
5060 }, 5031 },
5061 } 5032 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698