diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-11-18 05:34:10 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-11-18 05:34:10 (GMT) |
commit | d2d12ce0913e2ed0d54d043c387c2edf9fcf8683 (patch) | |
tree | d65583f6da4866a0d7f579356080c8727ca70973 | |
parent | 5c2a60e1c719d08a98d5a4adbf2e3c2efafa660d (diff) | |
parent | a1159ff0d500626069e75ed8e697f78df1befd4d (diff) | |
download | Ninja-d2d12ce0913e2ed0d54d043c387c2edf9fcf8683.zip Ninja-d2d12ce0913e2ed0d54d043c387c2edf9fcf8683.tar.gz Ninja-d2d12ce0913e2ed0d54d043c387c2edf9fcf8683.tar.bz2 |
Merge pull request #1053 from ninja-build/configure
Minor tweaks to the configure script
-rwxr-xr-x | configure.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/configure.py b/configure.py index 2104aff..d60cbac 100755 --- a/configure.py +++ b/configure.py @@ -265,11 +265,11 @@ if platform.is_msvc(): objext = '.obj' def src(filename): - return os.path.join('$sourcedir', 'src', filename) + return os.path.join('$root', 'src', filename) def built(filename): return os.path.join('$builddir', filename) def doc(filename): - return os.path.join('$sourcedir', 'doc', filename) + return os.path.join('$root', 'doc', filename) def cc(name, **kwargs): return n.build(built(name + objext), 'cxx', src(name + '.c'), **kwargs) def cxx(name, **kwargs): @@ -281,7 +281,12 @@ def binary(name): return exe return name -n.variable('sourcedir', sourcedir) +root = sourcedir +if root == os.getcwd(): + # In the common case where we're building directly in the source + # tree, simplify all the paths to just be cwd-relative. + root = '.' +n.variable('root', root) n.variable('builddir', 'build') n.variable('cxx', CXX) if platform.is_msvc(): @@ -321,11 +326,11 @@ if platform.is_msvc(): else: cflags = ['-g', '-Wall', '-Wextra', '-Wno-deprecated', + '-Wno-missing-field-initializers', '-Wno-unused-parameter', '-fno-rtti', '-fno-exceptions', '-fvisibility=hidden', '-pipe', - '-Wno-missing-field-initializers', '-DNINJA_PYTHON="%s"' % options.with_python] if options.debug: cflags += ['-D_GLIBCXX_DEBUG', '-D_GLIBCXX_DEBUG_PEDANTIC'] @@ -624,12 +629,12 @@ n.newline() if not host.is_mingw(): n.comment('Regenerate build files if build script changes.') n.rule('configure', - command='${configure_env}%s $sourcedir/configure.py $configure_args' % + command='${configure_env}%s $root/configure.py $configure_args' % options.with_python, generator=True) n.build('build.ninja', 'configure', - implicit=['$sourcedir/configure.py', - os.path.normpath('$sourcedir/misc/ninja_syntax.py')]) + implicit=['$root/configure.py', + os.path.normpath('$root/misc/ninja_syntax.py')]) n.newline() n.default(ninja) |