2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00

Enable lazy Visual Studio detection by default

This commit is contained in:
Thomas Nagy 2015-12-25 19:28:29 +01:00
parent 4111d559b4
commit a3e014b0ae
2 changed files with 11 additions and 9 deletions

2
TODO
View File

@ -1,7 +1,6 @@
Waf 1.9 Waf 1.9
------- -------
* Make lazy visual studio detection the default
* Do not cache waf tool detection * Do not cache waf tool detection
* Fix the vala detection * Fix the vala detection
* Better consistency between check_cfg and check_cc variables * Better consistency between check_cfg and check_cc variables
@ -25,4 +24,5 @@ Done
* Remove __hash__ and __eq__ from Node and Task #1629 * Remove __hash__ and __eq__ from Node and Task #1629
* Set cflags in the beginning / cppflags at the end #1505 * Set cflags in the beginning / cppflags at the end #1505
* Reduce the key size in bld.task_sigs by adding bld.node_sigs and bld.imp_sigs * Reduce the key size in bld.task_sigs by adding bld.node_sigs and bld.imp_sigs
* Make lazy visual studio detection the default

View File

@ -31,8 +31,8 @@ or::
Platforms and targets will be tested in the order they appear; Platforms and targets will be tested in the order they appear;
the first good configuration will be used. the first good configuration will be used.
To skip testing all the configurations that are not used, use the ``--msvc_lazy_autodetect`` option To force testing all the configurations that are not used, use the ``--no-msvc-lazy`` option
or set ``conf.env['MSVC_LAZY_AUTODETECT']=True``. or set ``conf.env['MSVC_LAZY_AUTODETECT']=False``.
Supported platforms: ia64, x64, x86, x86_amd64, x86_ia64, x86_arm, amd64_x86, amd64_arm Supported platforms: ia64, x64, x86, x86_amd64, x86_ia64, x86_arm, amd64_x86, amd64_arm
@ -94,7 +94,7 @@ all_icl_platforms = [ ('intel64', 'amd64'), ('em64t', 'amd64'), ('ia32', 'x86'),
def options(opt): def options(opt):
opt.add_option('--msvc_version', type='string', help = 'msvc version, eg: "msvc 10.0,msvc 9.0"', default='') opt.add_option('--msvc_version', type='string', help = 'msvc version, eg: "msvc 10.0,msvc 9.0"', default='')
opt.add_option('--msvc_targets', type='string', help = 'msvc targets, eg: "x64,arm"', default='') opt.add_option('--msvc_targets', type='string', help = 'msvc targets, eg: "x64,arm"', default='')
opt.add_option('--msvc_lazy_autodetect', action='store_true', help = 'lazily check msvc target environments') opt.add_option('--no-msvc-lazy', action='store_false', help = 'lazily check msvc target environments', default=True, dest=msvc_lazy)
def setup_msvc(conf, versions, arch = False): def setup_msvc(conf, versions, arch = False):
""" """
@ -330,10 +330,10 @@ def gather_msvc_detected_versions():
def get_compiler_env(conf, compiler, version, bat_target, bat, select=None): def get_compiler_env(conf, compiler, version, bat_target, bat, select=None):
""" """
Gets the compiler environment variables as a tuple. Evaluation is eager by default. Gets the compiler environment variables as a tuple. Evaluation is lazy by default,
If set to lazy with ``--msvc_lazy_autodetect`` or ``env.MSVC_LAZY_AUTODETECT`` which means destructuring can throw :py:class:`conf.errors.ConfigurationError`
the environment is evaluated when the tuple is destructured or iterated. This means If ``--no-msvc-lazy`` or ``env.MSVC_LAZY_AUTODETECT`` are set, then the values are
destructuring can throw :py:class:`conf.errors.ConfigurationError`. evaluated at once.
:param conf: configuration context to use to eventually get the version environment :param conf: configuration context to use to eventually get the version environment
:param compiler: compiler name :param compiler: compiler name
@ -341,7 +341,9 @@ def get_compiler_env(conf, compiler, version, bat_target, bat, select=None):
:param bat: path to the batch file to run :param bat: path to the batch file to run
:param select: optional function to take the realized environment variables tup and map it (e.g. to combine other constant paths) :param select: optional function to take the realized environment variables tup and map it (e.g. to combine other constant paths)
""" """
lazy = getattr(Options.options, 'msvc_lazy_autodetect', False) or conf.env['MSVC_LAZY_AUTODETECT'] lazy = getattr(Options.options, 'msvc_lazy', True)
if conf.env.MSVC_LAZY_AUTODETECT is False:
lazy = False
def msvc_thunk(): def msvc_thunk():
vs = conf.get_msvc_version(compiler, version, bat_target, bat) vs = conf.get_msvc_version(compiler, version, bat_target, bat)