summaryrefslogtreecommitdiff
path: root/scons
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2013-01-22 20:54:17 +0000
committerJosé Fonseca <jfonseca@vmware.com>2013-01-23 12:11:53 +0000
commit06424376065a4a1e44920a29497936691d88598f (patch)
treea17cab2cbf1138f6d6d2653a76205bf9621e4c91 /scons
parent60315e3eaf54a7eb646b787daa5f3ae560aee7a6 (diff)
scons: Fix source lists parsing on Windows.
/ vs \ mismatch was causing .objs to be put in the source tree, causing breakeage when doing different build types in the same tree (eg., debug vs release). Fix this by normalizing everything to / slashes. It's probably a good idea to purge all .objs from source tree to prevent issues completely.
Diffstat (limited to 'scons')
-rw-r--r--scons/custom.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scons/custom.py b/scons/custom.py
index 277c05b6797..658df97829b 100644
--- a/scons/custom.py
+++ b/scons/custom.py
@@ -240,6 +240,11 @@ def parse_source_list(env, filename, names=None):
top_srcdir = env.Dir('#').abspath
top_builddir = os.path.join(top_srcdir, env['build_dir'])
+ # Normalize everything to / slashes
+ cur_srcdir = cur_srcdir.replace('\\', '/')
+ top_srcdir = top_srcdir.replace('\\', '/')
+ top_builddir = top_builddir.replace('\\', '/')
+
# Populate the symbol table of the Makefile parser.
parser.add_symbol('top_srcdir', top_srcdir)
parser.add_symbol('top_builddir', top_builddir)
@@ -263,8 +268,8 @@ def parse_source_list(env, filename, names=None):
if f:
# Process source paths
if f.startswith(top_builddir + '/src'):
- # Automake puts build output on a `src` subdirectory, bue
- # SCons does no, so strip it here.
+ # Automake puts build output on a `src` subdirectory, but
+ # SCons does not, so strip it here.
f = top_builddir + f[len(top_builddir + '/src'):]
if f.startswith(cur_srcdir + '/'):
# Prefer relative source paths, as absolute files tend to