scons: Fix implicit python dependency discovery on Windows.

Probably due to CRLF endings, the discovery of python import statements
was not working on Windows builds, causing incremental builds to often
fail unless one wiped out the build directory.

NOTE: This is a candidate for stable branches.
This commit is contained in:
José Fonseca
2013-06-08 08:55:06 +01:00
parent 4f905d4900
commit 0aca2c6b60

View File

@@ -95,7 +95,7 @@ def createConvenienceLibBuilder(env):
# TODO: handle import statements with multiple modules # TODO: handle import statements with multiple modules
# TODO: handle from import statements # TODO: handle from import statements
import_re = re.compile(r'^import\s+(\S+)$', re.M) import_re = re.compile(r'^\s*import\s+(\S+)\s*$', re.M)
def python_scan(node, env, path): def python_scan(node, env, path):
# http://www.scons.org/doc/0.98.5/HTML/scons-user/c2781.html#AEN2789 # http://www.scons.org/doc/0.98.5/HTML/scons-user/c2781.html#AEN2789
@@ -113,6 +113,7 @@ def python_scan(node, env, path):
if os.path.exists(file): if os.path.exists(file):
results.append(env.File(file)) results.append(env.File(file))
break break
#print node, map(str, results)
return results return results
python_scanner = SCons.Scanner.Scanner(function = python_scan, skeys = ['.py']) python_scanner = SCons.Scanner.Scanner(function = python_scan, skeys = ['.py'])