From 574a9a64160b754774a700859abbeffb17ffc159 Mon Sep 17 00:00:00 2001 From: loonycyborg Date: Fri, 21 Mar 2014 06:38:44 +0400 Subject: [PATCH] scons: relocate config.h and revision.h to build directory --- SConstruct | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 452bcd9c2d9f..6a2e8120c40d 100755 --- a/SConstruct +++ b/SConstruct @@ -268,7 +268,7 @@ def Warning(message): return False from metasconf import init_metasconf -configure_args = dict(custom_tests = init_metasconf(env, ["cplusplus", "python_devel", "sdl", "boost", "pango", "pkgconfig", "gettext", "lua"]), config_h = "config.h", +configure_args = dict(custom_tests = init_metasconf(env, ["cplusplus", "python_devel", "sdl", "boost", "pango", "pkgconfig", "gettext", "lua"]), config_h = "$build_dir/config.h", log_file="$build_dir/config.log", conf_dir="$build_dir/sconf_temp") env.MergeFlags(env["extra_flags_config"]) @@ -402,7 +402,10 @@ if not env['nls']: # for env in [test_env, client_env, env]: - env.Prepend(CPPPATH = ["#/", "#/src"]) + build_root="#/" + if os.path.isabs(env["build_dir"]): + build_root = "" + env.Prepend(CPPPATH = [build_root + "$build_dir", "#/src"]) env.Append(CPPDEFINES = ["HAVE_CONFIG_H"]) @@ -455,7 +458,7 @@ if not env['static_test']: test_env.Append(CPPDEFINES = "BOOST_TEST_DYN_LINK") try: - if call("utils/autorevision -t h > revision.h", shell=True) == 0: + if call(env.subst("utils/autorevision -t h > $build_dir/revision.h"), shell=True) == 0: env["have_autorevision"] = True except: pass