Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 13950005: Fully qualify path to cl.exe for ninja windows, and support *_wrapper from environment (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pylib/gyp/msvs_emulation.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 Google Inc. All rights reserved. 1 # Copyright (c) 2013 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import copy 5 import copy
6 import hashlib 6 import hashlib
7 import multiprocessing 7 import multiprocessing
8 import os.path 8 import os.path
9 import re 9 import re
10 import signal 10 import signal
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) 364 self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec)
365 self.xcode_settings = self.msvs_settings = None 365 self.xcode_settings = self.msvs_settings = None
366 if self.flavor == 'mac': 366 if self.flavor == 'mac':
367 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) 367 self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec)
368 if self.flavor == 'win': 368 if self.flavor == 'win':
369 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, 369 self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec,
370 generator_flags) 370 generator_flags)
371 arch = self.msvs_settings.GetArch(config_name) 371 arch = self.msvs_settings.GetArch(config_name)
372 self.ninja.variable('arch', self.win_env[arch]) 372 self.ninja.variable('arch', self.win_env[arch])
373 self.ninja.variable('cc', '$cl_' + arch)
374 self.ninja.variable('cxx', '$cl_' + arch)
373 375
374 # Compute predepends for all rules. 376 # Compute predepends for all rules.
375 # actions_depends is the dependencies this target depends on before running 377 # actions_depends is the dependencies this target depends on before running
376 # any of its action/rule/copy steps. 378 # any of its action/rule/copy steps.
377 # compile_depends is the dependencies this target depends on before running 379 # compile_depends is the dependencies this target depends on before running
378 # any of its compile steps. 380 # any of its compile steps.
379 actions_depends = [] 381 actions_depends = []
380 compile_depends = [] 382 compile_depends = []
381 # TODO(evan): it is rather confusing which things are lists and which 383 # TODO(evan): it is rather confusing which things are lists and which
382 # are strings. Fix these. 384 # are strings. Fix these.
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 # The rules are 1365 # The rules are
1364 # - The priority from low to high is gcc/g++, the 'make_global_settings' in 1366 # - The priority from low to high is gcc/g++, the 'make_global_settings' in
1365 # gyp, the environment variable. 1367 # gyp, the environment variable.
1366 # - If there is no 'make_global_settings' for CC.host/CXX.host or 1368 # - If there is no 'make_global_settings' for CC.host/CXX.host or
1367 # 'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set 1369 # 'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set
1368 # to cc/cxx. 1370 # to cc/cxx.
1369 if flavor == 'win': 1371 if flavor == 'win':
1370 cc = 'cl.exe' 1372 cc = 'cl.exe'
1371 cxx = 'cl.exe' 1373 cxx = 'cl.exe'
1372 ld = 'link.exe' 1374 ld = 'link.exe'
1373 gyp.msvs_emulation.GenerateEnvironmentFiles( 1375 cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles(
1374 toplevel_build, generator_flags, OpenOutput) 1376 toplevel_build, generator_flags, OpenOutput)
1377 for arch, path in cl_paths.iteritems():
1378 master_ninja.variable('cl_' + arch, path)
1375 ld_host = '$ld' 1379 ld_host = '$ld'
1376 else: 1380 else:
1377 cc = 'gcc' 1381 cc = 'gcc'
1378 cxx = 'g++' 1382 cxx = 'g++'
1379 ld = '$cxx' 1383 ld = '$cxx'
1380 ld_host = '$cxx_host' 1384 ld_host = '$cxx_host'
1381 1385
1382 cc_host = None 1386 cc_host = None
1383 cxx_host = None 1387 cxx_host = None
1384 cc_host_global_setting = None 1388 cc_host_global_setting = None
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 if not cxx_host: 1427 if not cxx_host:
1424 cxx_host = cxx 1428 cxx_host = cxx
1425 1429
1426 if flavor == 'win': 1430 if flavor == 'win':
1427 master_ninja.variable('ld', ld) 1431 master_ninja.variable('ld', ld)
1428 master_ninja.variable('idl', 'midl.exe') 1432 master_ninja.variable('idl', 'midl.exe')
1429 master_ninja.variable('ar', 'lib.exe') 1433 master_ninja.variable('ar', 'lib.exe')
1430 master_ninja.variable('rc', 'rc.exe') 1434 master_ninja.variable('rc', 'rc.exe')
1431 master_ninja.variable('asm', 'ml.exe') 1435 master_ninja.variable('asm', 'ml.exe')
1432 master_ninja.variable('mt', 'mt.exe') 1436 master_ninja.variable('mt', 'mt.exe')
1433 master_ninja.variable('use_dep_database', '1')
Nico 2013/04/16 23:02:59 Was this ever used for anything? (I guess it was u
1434 else: 1437 else:
1435 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) 1438 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld))
1436 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], 'ar')) 1439 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], 'ar'))
1437 1440
1438 master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], 'ar')) 1441 master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], 'ar'))
1439 cc_host = GetEnvironFallback(['CC_host'], cc_host) 1442 cc_host = GetEnvironFallback(['CC_host'], cc_host)
1440 cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) 1443 cxx_host = GetEnvironFallback(['CXX_host'], cxx_host)
1441 ld_host = GetEnvironFallback(['LD_host'], ld_host) 1444 ld_host = GetEnvironFallback(['LD_host'], ld_host)
1442 1445
1443 # The environment variable could be used in 'make_global_settings', like 1446 # The environment variable could be used in 'make_global_settings', like
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 arglists.append( 1814 arglists.append(
1812 (target_list, target_dicts, data, params, config_name)) 1815 (target_list, target_dicts, data, params, config_name))
1813 pool.map(CallGenerateOutputForConfig, arglists) 1816 pool.map(CallGenerateOutputForConfig, arglists)
1814 except KeyboardInterrupt, e: 1817 except KeyboardInterrupt, e:
1815 pool.terminate() 1818 pool.terminate()
1816 raise e 1819 raise e
1817 else: 1820 else:
1818 for config_name in config_names: 1821 for config_name in config_names:
1819 GenerateOutputForConfig(target_list, target_dicts, data, params, 1822 GenerateOutputForConfig(target_list, target_dicts, data, params,
1820 config_name) 1823 config_name)
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/msvs_emulation.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698