Index: build/linux/sysroot_scripts/install-sysroot.py |
diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py |
index b8f34edb3ff822bc2474908d40b8e4a18ee79224..591999d566accb6d12b3a8aea162b77d23ed27c5 100755 |
--- a/build/linux/sysroot_scripts/install-sysroot.py |
+++ b/build/linux/sysroot_scripts/install-sysroot.py |
@@ -91,11 +91,6 @@ def DetectTargetArch(): |
This works by looking for target_arch in GYP_DEFINES. |
""" |
- # TODO(agrieve): Make this script not depend on GYP_DEFINES so that it works |
- # with GN as well. |
- gyp_environment.SetEnvironment() |
- supplemental_includes = gyp_chromium.GetSupplementalFiles() |
- gyp_defines = gyp_chromium.GetGypVars(supplemental_includes) |
target_arch = gyp_defines.get('target_arch') |
if target_arch == 'x64': |
return 'amd64' |
@@ -139,6 +134,10 @@ def main(): |
if options.running_as_hook and not sys.platform.startswith('linux'): |
return 0 |
+ if gyp_defines.has_key('use_sysroot') \ |
+ and int(gyp_defines['use_sysroot']) == 0: |
Sam Clegg
2015/12/17 22:17:06
What about just `gyp_defines.get('use_sysroot') ==
|
+ return 0 |
+ |
if options.running_as_hook: |
InstallDefaultSysroots() |
else: |
@@ -216,4 +215,11 @@ if __name__ == '__main__': |
parser.add_option('--arch', type='choice', choices=valid_archs, |
help='Sysroot architecture: %s' % ', '.join(valid_archs)) |
options, _ = parser.parse_args() |
+ |
+ # TODO(agrieve): Make this script not depend on GYP_DEFINES so that it works |
+ # with GN as well. |
+ gyp_environment.SetEnvironment() |
+ supplemental_includes = gyp_chromium.GetSupplementalFiles() |
+ gyp_defines = gyp_chromium.GetGypVars(supplemental_includes) |
Sam Clegg
2015/12/17 22:15:45
Can you do this in main and pass gyp_defines to De
|
+ |
sys.exit(main()) |