Bug 1560044 - Make Xcode checks macOS host only. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 02 Jul 2019 23:24:57 +0000
changeset 540842 715b1861e5ac867e1ad5b3cc2b4ac78aa1cdb472
parent 540841 3fd5b373540bef90c66d7ab389c696b45893c26c
child 540843 2d423fa9037df34c472baf869bee6c110c81b7cf
push id11529
push userarchaeopteryx@coole-files.de
push dateThu, 04 Jul 2019 15:22:33 +0000
treeherdermozilla-beta@ebb510a784b8 [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 - Make Xcode checks macOS host only. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D36559
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -199,59 +199,59 @@ with only_when(target_is_osx):
     def macos_private_frameworks(value):
         if value:
             return value
         return '/System/Library/PrivateFrameworks'
 
     set_config('MACOS_PRIVATE_FRAMEWORKS_DIR', macos_private_frameworks)
 
 
-# Xcode state
-# ===========
-
-js_option('--disable-xcode-checks',
-          help='Do not check that Xcode is installed and properly configured')
-
-
-@depends(host, '--disable-xcode-checks')
-def xcode_path(host, xcode_checks):
-    if host.kernel != 'Darwin' or not xcode_checks:
-        return
-
-    # xcode-select -p prints the path to the installed Xcode. It
-    # should exit 0 and return non-empty result if Xcode is installed.
-
-    def bad_xcode_select():
-        die('Could not find installed Xcode; install Xcode from the App '
-            'Store, run it once to perform initial configuration, and then '
-            'try again; in the rare case you wish to build without Xcode '
-            'installed, add the --disable-xcode-checks configure flag')
-
-    xcode_path = check_cmd_output('xcode-select', '--print-path',
-                                  onerror=bad_xcode_select).strip()
-
-    if not xcode_path:
-        bad_xcode_select()
-
-    # Now look for the Command Line Tools.
-    def no_cltools():
-        die('Could not find installed Xcode Command Line Tools; '
-            'run `xcode-select --install` and follow the instructions '
-            'to install them then try again; if you wish to build without '
-            'Xcode Command Line Tools installed, '
-            'add the --disable-xcode-checks configure flag')
-
-    check_cmd_output('pkgutil', '--pkg-info',
-                     'com.apple.pkg.CLTools_Executables',
-                     onerror=no_cltools)
-
-    return xcode_path
-
-
-set_config('XCODE_PATH', xcode_path)
+with only_when(host_is_osx):
+    # Xcode state
+    # ===========
+    js_option('--disable-xcode-checks',
+	      help='Do not check that Xcode is installed and properly configured')
+
+
+    @depends(host, '--disable-xcode-checks')
+    def xcode_path(host, xcode_checks):
+	if host.kernel != 'Darwin' or not xcode_checks:
+	    return
+
+	# xcode-select -p prints the path to the installed Xcode. It
+	# should exit 0 and return non-empty result if Xcode is installed.
+
+	def bad_xcode_select():
+	    die('Could not find installed Xcode; install Xcode from the App '
+		'Store, run it once to perform initial configuration, and then '
+		'try again; in the rare case you wish to build without Xcode '
+		'installed, add the --disable-xcode-checks configure flag')
+
+	xcode_path = check_cmd_output('xcode-select', '--print-path',
+				      onerror=bad_xcode_select).strip()
+
+	if not xcode_path:
+	    bad_xcode_select()
+
+	# Now look for the Command Line Tools.
+	def no_cltools():
+	    die('Could not find installed Xcode Command Line Tools; '
+		'run `xcode-select --install` and follow the instructions '
+		'to install them then try again; if you wish to build without '
+		'Xcode Command Line Tools installed, '
+		'add the --disable-xcode-checks configure flag')
+
+	check_cmd_output('pkgutil', '--pkg-info',
+			 'com.apple.pkg.CLTools_Executables',
+			 onerror=no_cltools)
+
+	return xcode_path
+
+
+    set_config('XCODE_PATH', xcode_path)
 
 
 # Compiler wrappers
 # ==============================================================
 # Normally, we'd use js_option and automatically have those variables
 # propagated to js/src, but things are complicated by possible additional
 # wrappers in CC/CXX, and by other subconfigures that do not handle those
 # options and do need CC/CXX altered.