diff options
author | garyo <devnull@localhost> | 2012-11-18 03:38:57 (GMT) |
---|---|---|
committer | garyo <devnull@localhost> | 2012-11-18 03:38:57 (GMT) |
commit | b4825b4662c5c41b96b0f2ad07c3cae34681b1f7 (patch) | |
tree | 84f653059a5bd54b200046b0ac7801b353f31c33 | |
parent | 8472b14ce10db2aec806dbabaf713fd8a6fb0750 (diff) | |
parent | 649f2dee6dcaaeb6897b1753ad0a6e14a22b0b9f (diff) | |
download | SCons-b4825b4662c5c41b96b0f2ad07c3cae34681b1f7.zip SCons-b4825b4662c5c41b96b0f2ad07c3cae34681b1f7.tar.gz SCons-b4825b4662c5c41b96b0f2ad07c3cae34681b1f7.tar.bz2 |
Merge pull request #51 from Anatoly Techtonik; allow running scripts/scons.py from source dir
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/script/scons.py | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 4af8d49..13d8f7c 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,6 +6,9 @@ RELEASE 2.X.X - + From Anatoly Techtonik: + - Added ability to run scripts/scons.py directly from source checkout + From Juan Lang: - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output diff --git a/src/script/scons.py b/src/script/scons.py index 86d2562..cd8b432 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -184,7 +184,15 @@ sys.path = libs + sys.path ############################################################################## if __name__ == "__main__": - import SCons.Script + try: + import SCons.Script + except: + ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'engine') + if os.path.exists(ROOT): + sys.path += [ROOT] + print("SCons import failed. Trying to run from source directory") + import SCons.Script + # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() |