diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-06 00:46:29 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-06 00:46:29 +0000 |
commit | 2c26153de7c9ddaafb6ff7dcecc7eacf64820883 (patch) | |
tree | 1f8bc76c9b87984f04210c3f23bac0655df348a9 /build | |
parent | df10e1781ce06472e3c381c73a9819e7ffabb6ab (diff) | |
download | chromium_src-2c26153de7c9ddaafb6ff7dcecc7eacf64820883.zip chromium_src-2c26153de7c9ddaafb6ff7dcecc7eacf64820883.tar.gz chromium_src-2c26153de7c9ddaafb6ff7dcecc7eacf64820883.tar.bz2 |
When doing an official build, don't bail out if Xcode doesn't know about the
SDK to verify when an SDK path is set. The SDK path supersedes whatever
find_sdk is supposed to find.
Also: Reorganize the SDK and deployment target variables to be scoped more
appropriately. Add a mac_sdk_min variable to set the main argument to
find_sdk.
Review URL: https://chromiumcodereview.appspot.com/11068023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/common.gypi | 92 | ||||
-rwxr-xr-x | build/mac/find_sdk.py | 5 |
2 files changed, 59 insertions, 38 deletions
diff --git a/build/common.gypi b/build/common.gypi index efac0da..6e435f4 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -345,14 +345,6 @@ # for details. 'chromium_win_pch%': 0, - # iOS SDK and deployment target support. The iOS 5.0 SDK is actually - # what is required, but the value is left blank so when it is set in - # the project files it will be the "current" iOS SDK. Forcing 5.0 - # even though it is "current" causes Xcode to spit out a warning for - # every single project file for not using the "current" SDK. - 'ios_sdk%': '', - 'ios_deployment_target%': '4.3', - # Set this to true when building with Clang. # See http://code.google.com/p/chromium/wiki/Clang for details. 'clang%': 0, @@ -648,8 +640,6 @@ 'enable_extensions%': '<(enable_extensions)', 'enable_web_intents%': '<(enable_web_intents)', 'enable_web_intents_tag%': '<(enable_web_intents_tag)', - 'ios_sdk%': '<(ios_sdk)', - 'ios_deployment_target%': '<(ios_deployment_target)', 'enable_plugin_installation%': '<(enable_plugin_installation)', 'enable_protector_service%': '<(enable_protector_service)', 'enable_session_service%': '<(enable_session_service)', @@ -703,26 +693,6 @@ # Linux-Mac cross compiler distcc farm. 'chromium_mac_pch%': 1, - # Mac OS X SDK and deployment target support. - # The SDK identifies the version of the system headers that will be used, - # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro. - # "Maximum allowed" refers to the operating system version whose APIs are - # available in the headers. - # The deployment target identifies the minimum system version that the - # built products are expected to function on. It corresponds to the - # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. - # To ensure these macros are available, #include <AvailabilityMacros.h>. - # Additional documentation on these macros is available at - # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3 - # Chrome normally builds with the Mac OS X 10.6 SDK and sets the - # deployment target to 10.6. Other projects, such as O3D, may override - # these defaults. If the SDK is installed someplace that Xcode doesn't - # know about, set mac_sdk_path to the path to the SDK. If set to a - # non-empty string, mac_sdk_path will be used in preference to mac_sdk. - # mac_sdk gets its default value elsewhere in this file. - 'mac_sdk_path%': '', - 'mac_deployment_target%': '10.6', - # The default value for mac_strip in target_defaults. This cannot be # set there, per the comment about variable% in a target_defaults. 'mac_strip_release%': 1, @@ -999,6 +969,15 @@ # sub-builds. This allows the Mac sub-build SDK in an iOS build to be # overridden from the command line the same way it is for a Mac build. 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)', + + # iOS SDK and deployment target support. The iOS 5.0 SDK is actually + # what is required, but the value is left blank so when it is set in + # the project files it will be the "current" iOS SDK. Forcing 5.0 + # even though it is "current" causes Xcode to spit out a warning for + # every single project file for not using the "current" SDK. + 'ios_sdk%': '', + 'ios_sdk_path%': '', + 'ios_deployment_target%': '4.3', }], ['OS=="android"', { # Location of Android NDK. @@ -1109,8 +1088,41 @@ 'android_build_type%': '<(android_build_type)', }], # OS=="android" ['OS=="mac"', { + 'variables': { + # Mac OS X SDK and deployment target support. The SDK identifies + # the version of the system headers that will be used, and + # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time + # macro. "Maximum allowed" refers to the operating system version + # whose APIs are available in the headers. The deployment target + # identifies the minimum system version that the built products are + # expected to function on. It corresponds to the + # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro. To ensure these + # macros are available, #include <AvailabilityMacros.h>. Additional + # documentation on these macros is available at + # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3 + # Chrome normally builds with the Mac OS X 10.6 SDK and sets the + # deployment target to 10.6. Other projects, such as O3D, may + # override these defaults. + + # Normally, mac_sdk_min is used to find an SDK that Xcode knows + # about that is at least the specified version. In official builds, + # the SDK must match mac_sdk_min exactly. If the SDK is installed + # someplace that Xcode doesn't know about, set mac_sdk_path to the + # path to the SDK; when set to a non-empty string, SDK detection + # based on mac_sdk_min will be bypassed entirely. + 'mac_sdk_min%': '10.6', + 'mac_sdk_path%': '', + + 'mac_deployment_target%': '10.6', + }, + + 'mac_sdk_min': '<(mac_sdk_min)', + 'mac_sdk_path': '<(mac_sdk_path)', + 'mac_deployment_target': '<(mac_deployment_target)', + # Enable clang on mac by default! 'clang%': 1, + # Compile in Breakpad support by default so that it can be # tested, even if it is not enabled by default at runtime. 'mac_breakpad_compiled_in%': 1, @@ -1127,7 +1139,7 @@ }], ['branding=="Chrome" and buildtype=="Official"', { - 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify 10.6)', + 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))', # Enable uploading crash dumps. 'mac_breakpad_uploads%': 1, # Enable dumping symbols at build time for use by Mac Breakpad. @@ -1135,7 +1147,7 @@ # Enable Keystone auto-update support. 'mac_keystone%': 1, }, { # else: branding!="Chrome" or buildtype!="Official" - 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py 10.6)', + 'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))', 'mac_breakpad_uploads%': 0, 'mac_breakpad%': 0, 'mac_keystone%': 0, @@ -3560,17 +3572,23 @@ # setting sets the SDK on a project-wide basis. In order to get the # configured SDK to show properly in the Xcode UI, SDKROOT must be set # here at the project level. - ['mac_sdk_path==""', { + ['OS=="mac"', { 'conditions': [ - ['OS=="mac"', { + ['mac_sdk_path==""', { 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot + }, { + 'SDKROOT': '<(mac_sdk_path)', # -isysroot }], - ['OS=="ios"', { + ], + }], + ['OS=="ios"', { + 'conditions': [ + ['ios_sdk_path==""', { 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot + }, { + 'SDKROOT': '<(ios_sdk_path)', # -isysroot }], ], - }, { # else: mac_sdk_path!="" - 'SDKROOT': '<(mac_sdk_path)', # -isysroot }], ['OS=="ios"', { # Just build armv7 since iOS 4.3+ only supports armv7. diff --git a/build/mac/find_sdk.py b/build/mac/find_sdk.py index 0b19c30..067be63 100755 --- a/build/mac/find_sdk.py +++ b/build/mac/find_sdk.py @@ -28,6 +28,9 @@ def main(): parser.add_option("--verify", action="store_true", dest="verify", default=False, help="return the sdk argument and warn if it doesn't exist") + parser.add_option("--sdk_path", + action="store", type="string", dest="sdk_path", default="", + help="user-specified SDK path; bypasses verification") (options, args) = parser.parse_args() min_sdk_version = args[0] @@ -56,7 +59,7 @@ def main(): raise Exception('No %s+ SDK found' % min_sdk_version) best_sdk = sorted(sdks, key=parse_version)[0] - if options.verify and best_sdk != min_sdk_version: + if options.verify and best_sdk != min_sdk_version and not options.sdk_path: print >>sys.stderr, '' print >>sys.stderr, ' vvvvvvv' print >>sys.stderr, '' |