Skip to content

Commit

Permalink
scons: relocate config.h and revision.h to build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Mar 21, 2014
1 parent 69b9b01 commit d585897
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions SConstruct
Expand Up @@ -269,7 +269,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"])
Expand Down Expand Up @@ -418,7 +418,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"])

Expand Down Expand Up @@ -471,7 +474,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
Expand Down

0 comments on commit d585897

Please sign in to comment.