OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This script is wrapper for Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 21 matching lines...) Expand all Loading... |
32 sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit')) | 32 sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit')) |
33 sys.path.insert(1, os.path.join(chrome_src, 'chrome', 'tools', 'build')) | 33 sys.path.insert(1, os.path.join(chrome_src, 'chrome', 'tools', 'build')) |
34 sys.path.insert(1, os.path.join(chrome_src, 'native_client', 'build')) | 34 sys.path.insert(1, os.path.join(chrome_src, 'native_client', 'build')) |
35 sys.path.insert(1, os.path.join(chrome_src, 'native_client_sdk', 'src', | 35 sys.path.insert(1, os.path.join(chrome_src, 'native_client_sdk', 'src', |
36 'build_tools')) | 36 'build_tools')) |
37 sys.path.insert(1, os.path.join(chrome_src, 'remoting', 'tools', 'build')) | 37 sys.path.insert(1, os.path.join(chrome_src, 'remoting', 'tools', 'build')) |
38 sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'liblouis')) | 38 sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'liblouis')) |
39 sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'WebKit', | 39 sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'WebKit', |
40 'Source', 'build', 'scripts')) | 40 'Source', 'build', 'scripts')) |
41 | 41 |
42 import find_depot_tools | 42 if os.environ.get('GYP_GENERATORS') != 'make': |
| 43 import find_depot_tools |
43 | 44 |
44 # On Windows, Psyco shortens warm runs of build/gyp_chromium by about | 45 # On Windows, Psyco shortens warm runs of build/gyp_chromium by about |
45 # 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70 | 46 # 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70 |
46 # seconds. Conversely, memory usage of build/gyp_chromium with Psyco | 47 # seconds. Conversely, memory usage of build/gyp_chromium with Psyco |
47 # maxes out at about 158 MB vs. 132 MB without it. | 48 # maxes out at about 158 MB vs. 132 MB without it. |
48 # | 49 # |
49 # Psyco uses native libraries, so we need to load a different | 50 # Psyco uses native libraries, so we need to load a different |
50 # installation depending on which OS we are running under. It has not | 51 # installation depending on which OS we are running under. It has not |
51 # been tested whether using Psyco on our Mac and Linux builds is worth | 52 # been tested whether using Psyco on our Mac and Linux builds is worth |
52 # it (the GYP running time is a lot shorter, so the JIT startup cost | 53 # it (the GYP running time is a lot shorter, so the JIT startup cost |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 print('Using automatic toolchain in %s (%s edition).' % ( | 468 print('Using automatic toolchain in %s (%s edition).' % ( |
468 toolchain, 'Pro' if version_is_pro else 'Express')) | 469 toolchain, 'Pro' if version_is_pro else 'Express')) |
469 | 470 |
470 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check | 471 # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check |
471 # to enfore syntax checking. | 472 # to enfore syntax checking. |
472 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 473 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
473 if syntax_check and int(syntax_check): | 474 if syntax_check and int(syntax_check): |
474 args.append('--check') | 475 args.append('--check') |
475 | 476 |
476 supplemental_includes = GetSupplementalFiles() | 477 supplemental_includes = GetSupplementalFiles() |
477 if not RunGN(supplemental_includes): | 478 if os.environ.get('GYP_GENERATORS') != 'make': |
478 sys.exit(1) | 479 if not RunGN(supplemental_includes): |
| 480 sys.exit(1) |
479 args.extend( | 481 args.extend( |
480 ['-I' + i for i in additional_include_files(supplemental_includes, args)]) | 482 ['-I' + i for i in additional_include_files(supplemental_includes, args)]) |
481 | 483 |
482 args.extend(['-D', 'gyp_output_dir=' + GetOutputDirectory()]) | 484 args.extend(['-D', 'gyp_output_dir=' + GetOutputDirectory()]) |
483 | 485 |
484 print 'Updating projects from gyp files...' | 486 print 'Updating projects from gyp files...' |
485 sys.stdout.flush() | 487 sys.stdout.flush() |
486 | 488 |
487 # Off we go... | 489 # Off we go... |
488 gyp_rc = gyp.main(args) | 490 gyp_rc = gyp.main(args) |
489 | 491 |
490 # Check for landmines (reasons to clobber the build). This must be run here, | 492 # Check for landmines (reasons to clobber the build). This must be run here, |
491 # rather than a separate runhooks step so that any environment modifications | 493 # rather than a separate runhooks step so that any environment modifications |
492 # from above are picked up. | 494 # from above are picked up. |
493 print 'Running build/landmines.py...' | 495 print 'Running build/landmines.py...' |
494 subprocess.check_call( | 496 subprocess.check_call( |
495 [sys.executable, os.path.join(script_dir, 'landmines.py')]) | 497 [sys.executable, os.path.join(script_dir, 'landmines.py')]) |
496 | 498 |
497 if vs2013_runtime_dll_dirs: | 499 if vs2013_runtime_dll_dirs: |
498 CopyVsRuntimeDlls(GetOutputDirectory(), vs2013_runtime_dll_dirs) | 500 CopyVsRuntimeDlls(GetOutputDirectory(), vs2013_runtime_dll_dirs) |
499 | 501 |
500 sys.exit(gyp_rc) | 502 sys.exit(gyp_rc) |
OLD | NEW |