summaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2015-11-17 22:28:08 (GMT)
committerEvan Martin <martine@danga.com>2015-11-17 22:42:12 (GMT)
commita1159ff0d500626069e75ed8e697f78df1befd4d (patch)
treed65583f6da4866a0d7f579356080c8727ca70973 /configure.py
parent424325728862347298013c1e39761e51e0e79e9d (diff)
downloadNinja-a1159ff0d500626069e75ed8e697f78df1befd4d.zip
Ninja-a1159ff0d500626069e75ed8e697f78df1befd4d.tar.gz
Ninja-a1159ff0d500626069e75ed8e697f78df1befd4d.tar.bz2
when building with cwd = source root, use relative paths
The pull request that introduced building from a directory other than the source dir, https://github.com/ninja-build/ninja/pull/979, made it so all source paths are effectively absolute paths. This change restores the old behavior in the case when you are building in the source. See the comments there.
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.py b/configure.py
index 845b046..d60cbac 100755
--- a/configure.py
+++ b/configure.py
@@ -281,7 +281,12 @@ def binary(name):
return exe
return name
-n.variable('root', 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():