SConstruct: change rollback_option to free function
It shouldn't be a conftest. First, it doesn't act like one. Second, calling it as conf.rollback_option from within another conftest before calling context.Result confuses scons, it doesn't expect conftests to be nested and reports "error: no result" for the outer one as soon as the inner is called.
This commit is contained in:
parent
16eb870303
commit
89d0c6da19
1 changed files with 8 additions and 10 deletions
18
SConstruct
18
SConstruct
|
@ -491,6 +491,12 @@ for opt in opts.options:
|
||||||
if opt.key not in pickle_store:
|
if opt.key not in pickle_store:
|
||||||
pickle_store.append(opt.key)
|
pickle_store.append(opt.key)
|
||||||
|
|
||||||
|
def rollback_option(env, variable):
|
||||||
|
global opts
|
||||||
|
for item in opts.options:
|
||||||
|
if item.key == variable:
|
||||||
|
env[variable] = item.default
|
||||||
|
|
||||||
# Method of adding configure behavior to Scons adapted from:
|
# Method of adding configure behavior to Scons adapted from:
|
||||||
# http://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk/FreeOrion/SConstruct
|
# http://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk/FreeOrion/SConstruct
|
||||||
preconfigured = False
|
preconfigured = False
|
||||||
|
@ -631,7 +637,7 @@ def parse_config(context, config, checks='--libs --cflags'):
|
||||||
# optional deps...
|
# optional deps...
|
||||||
if tool not in env['SKIPPED_DEPS']:
|
if tool not in env['SKIPPED_DEPS']:
|
||||||
env['SKIPPED_DEPS'].append(tool)
|
env['SKIPPED_DEPS'].append(tool)
|
||||||
conf.rollback_option(config)
|
rollback_option(env, config)
|
||||||
else: # freetype and libxml2, not optional
|
else: # freetype and libxml2, not optional
|
||||||
if tool not in env['MISSING_DEPS']:
|
if tool not in env['MISSING_DEPS']:
|
||||||
env['MISSING_DEPS'].append(tool)
|
env['MISSING_DEPS'].append(tool)
|
||||||
|
@ -681,7 +687,7 @@ def parse_pg_config(context, config):
|
||||||
env.Append(LIBS = lpq)
|
env.Append(LIBS = lpq)
|
||||||
else:
|
else:
|
||||||
env['SKIPPED_DEPS'].append(tool)
|
env['SKIPPED_DEPS'].append(tool)
|
||||||
conf.rollback_option(config)
|
rollback_option(env, config)
|
||||||
context.Result( ret )
|
context.Result( ret )
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
@ -695,13 +701,6 @@ def ogr_enabled(context):
|
||||||
context.Result( ret )
|
context.Result( ret )
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def rollback_option(context,variable):
|
|
||||||
global opts
|
|
||||||
env = context.env
|
|
||||||
for item in opts.options:
|
|
||||||
if item.key == variable:
|
|
||||||
env[variable] = item.default
|
|
||||||
|
|
||||||
def FindBoost(context, prefixes, thread_flag):
|
def FindBoost(context, prefixes, thread_flag):
|
||||||
"""Routine to auto-find boost header dir, lib dir, and library naming structure.
|
"""Routine to auto-find boost header dir, lib dir, and library naming structure.
|
||||||
|
|
||||||
|
@ -1200,7 +1199,6 @@ conf_tests = { 'prioritize_paths' : prioritize_paths,
|
||||||
'parse_pg_config' : parse_pg_config,
|
'parse_pg_config' : parse_pg_config,
|
||||||
'ogr_enabled' : ogr_enabled,
|
'ogr_enabled' : ogr_enabled,
|
||||||
'get_pkg_lib' : get_pkg_lib,
|
'get_pkg_lib' : get_pkg_lib,
|
||||||
'rollback_option' : rollback_option,
|
|
||||||
'icu_at_least' : icu_at_least,
|
'icu_at_least' : icu_at_least,
|
||||||
'harfbuzz_version' : harfbuzz_version,
|
'harfbuzz_version' : harfbuzz_version,
|
||||||
'harfbuzz_with_freetype_support': harfbuzz_with_freetype_support,
|
'harfbuzz_with_freetype_support': harfbuzz_with_freetype_support,
|
||||||
|
|
Loading…
Reference in a new issue