diff options
author | Steven Knight <knight@baldmt.com> | 2006-01-20 06:09:04 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2006-01-20 06:09:04 (GMT) |
commit | 8029f3079db3fcd71d4fc10e3d6cc28987349b56 (patch) | |
tree | 3ee93d651adaef0925ee9608dd304389f2610003 /etc | |
parent | 94dbfd9cae5e8078e766c5aec8ae33b6fbeb2644 (diff) | |
download | SCons-8029f3079db3fcd71d4fc10e3d6cc28987349b56.zip SCons-8029f3079db3fcd71d4fc10e3d6cc28987349b56.tar.gz SCons-8029f3079db3fcd71d4fc10e3d6cc28987349b56.tar.bz2 |
Add support for Visual Studio 8, and multiple project files in a solution file. (Matthias)
Diffstat (limited to 'etc')
-rw-r--r-- | etc/TestSCons.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/etc/TestSCons.py b/etc/TestSCons.py index 901c762..87eadfb 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -473,7 +473,10 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS']) contents = string.replace(contents, orig, replace) self.write(fname, contents) - def msvs_substitute(self, input, msvs_ver, subdir=None, sconscript=None, python=sys.executable): + def msvs_substitute(self, input, msvs_ver, + subdir=None, sconscript=None, + python=sys.executable, + project_guid=None): if not hasattr(self, '_msvs_versions'): self.msvs_versions() @@ -482,10 +485,16 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS']) else: workpath = self.workpath() - if not sconscript: + if sconscript is None: sconscript = self.workpath('SConstruct') - exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%s'), join(sys.prefix, 'scons-%s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % (self._scons_version, self._scons_version) + if project_guid is None: + project_guid = "{E5466E26-0003-F18B-8F8A-BCD76C86388D}" + + if os.environ.has_key('SCONS_LIB_DIR'): + exec_script_main = "from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()" % os.environ['SCONS_LIB_DIR'] + else: + exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%s'), join(sys.prefix, 'scons-%s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % (self._scons_version, self._scons_version) exec_script_main_xml = string.replace(exec_script_main, "'", "'") result = string.replace(input, r'<WORKPATH>', workpath) @@ -493,6 +502,7 @@ print "self._msvs_versions =", str(env['MSVS']['VERSIONS']) result = string.replace(result, r'<SCONSCRIPT>', sconscript) result = string.replace(result, r'<SCONS_SCRIPT_MAIN>', exec_script_main) result = string.replace(result, r'<SCONS_SCRIPT_MAIN_XML>', exec_script_main_xml) + result = string.replace(result, r'<PROJECT_GUID>', project_guid) return result # In some environments, $AR will generate a warning message to stderr |