diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-05-04 15:33:46 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-05-04 15:33:46 (GMT) |
commit | aeeb99e49fd84dd1f890be6d4c9c7d361741e706 (patch) | |
tree | e5f5b824e86c1231b13d26af24ef138c56da8842 /configure.py | |
parent | 3253f66fd14fce3278f71b29a22d61bf1b4aa9f5 (diff) | |
download | Ninja-aeeb99e49fd84dd1f890be6d4c9c7d361741e706.zip Ninja-aeeb99e49fd84dd1f890be6d4c9c7d361741e706.tar.gz Ninja-aeeb99e49fd84dd1f890be6d4c9c7d361741e706.tar.bz2 |
Let configure.py remember its environment for rerunning.
Without this, CXX is lost when ninja decides that it's time to
regenerate build.ninja, which makes performance tweaking surprising.
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/configure.py b/configure.py index 8f965c8..a719536 100755 --- a/configure.py +++ b/configure.py @@ -72,6 +72,9 @@ n.newline() n.comment('The arguments passed to configure.py, for rerunning it.') n.variable('configure_args', ' '.join(sys.argv[1:])) +env_keys = set(['CXX', 'AR', 'CFLAGS', 'LDFLAGS']) +configure_env = [k + '=' + os.environ[k] for k in os.environ if k in env_keys] +n.variable('configure_env', ' '.join(configure_env)) n.newline() objext = '.o' @@ -351,7 +354,8 @@ n.newline() if host != 'mingw': n.comment('Regenerate build files if build script changes.') n.rule('configure', - command=options.with_python + ' configure.py $configure_args', + command='$configure_env %s configure.py $configure_args' % + options.with_python, generator=True) n.build('build.ninja', 'configure', implicit=['configure.py', 'misc/ninja_syntax.py']) |