OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Prints "1" if Chrome targets should be built with hermetic xcode. Otherwise | 6 """Prints "1" if Chrome targets should be built with hermetic xcode. Otherwise |
7 prints "0".""" | 7 prints "0". |
| 8 |
| 9 Usage: |
| 10 python should_use_hermetic_xcode.py <target_os> |
| 11 """ |
8 | 12 |
9 import os | 13 import os |
10 import sys | 14 import sys |
11 | 15 |
12 | 16 |
13 def _IsCorpMachine(): | 17 def _IsCorpMachine(): |
14 return os.path.isdir('/Library/GoogleCorpSupport/') | 18 return os.path.isdir('/Library/GoogleCorpSupport/') |
15 | 19 |
16 | 20 |
17 def main(): | 21 def main(): |
18 if os.environ.get('FORCE_MAC_TOOLCHAIN') or _IsCorpMachine(): | 22 allow_corp = sys.argv[1] == 'mac' and _IsCorpMachine() |
| 23 if os.environ.get('FORCE_MAC_TOOLCHAIN') or allow_corp: |
19 return "1" | 24 return "1" |
20 else: | 25 else: |
21 return "0" | 26 return "0" |
22 | 27 |
23 | 28 |
24 if __name__ == '__main__': | 29 if __name__ == '__main__': |
25 print main() | 30 print main() |
26 sys.exit(0) | 31 sys.exit(0) |
OLD | NEW |