Bug 1560044 - Allow --with-macos-sdk as an option when cross-compiling on macOS. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 02 Jul 2019 23:25:01 +0000
changeset 544029 9114bef9e25a145de8223c42cb3555fd5bab942e
parent 544028 dc667205f53f0dd5eb291be24a5462be8ff7fc0f
child 544030 3fd5b373540bef90c66d7ab389c696b45893c26c
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1560044
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1560044 - Allow --with-macos-sdk as an option when cross-compiling on macOS. r=nalexander Building host tools on macOS require a macOS SDK, but it's currently not configurable when cross-compiling for e.g. Android. Differential Revision: https://phabricator.services.mozilla.com/D36557
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -118,19 +118,26 @@ with only_when(target_is_osx):
             # Ensure every compiler process we spawn uses this value.
             environ['MACOSX_DEPLOYMENT_TARGET'] = value[0]
             return value[0]
 
 
     set_config('MACOSX_DEPLOYMENT_TARGET', macos_target)
     add_old_configure_assignment('MACOSX_DEPLOYMENT_TARGET', macos_target)
 
+
+@depends(host)
+def host_is_osx(host):
+    if host.os == 'OSX':
+        return True
+
+
+with only_when(host_is_osx | target_is_osx):
     # MacOS SDK
     # =========
-
     js_option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
            help='Location of platform SDK to use')
 
     @depends_if('--with-macos-sdk')
     @imports(_from='os.path', _import='isdir')
     @imports(_from='biplist', _import='readPlist')
     def macos_sdk(value):
         sdk_min_version = Version('10.11')
@@ -156,16 +163,18 @@ with only_when(target_is_osx):
             die('SDK version "%s" is unsupported. Please downgrade to version '
                 '%s. You may need to point to it using --with-macos-sdk=<path> in '
                 'your mozconfig. Various SDK versions are available from '
                 'https://github.com/phracker/MacOSX-SDKs' % (version, sdk_max_version))
         return value[0]
 
     set_config('MACOS_SDK_DIR', macos_sdk)
 
+
+with only_when(target_is_osx):
     with only_when(cross_compiling):
         option('--with-macos-private-frameworks',
                env="MACOS_PRIVATE_FRAMEWORKS_DIR", nargs=1,
                help='Location of private frameworks to use')
 
         @depends_if('--with-macos-private-frameworks')
         @imports(_from='os.path', _import='isdir')
         def macos_private_frameworks(value):