summaryrefslogtreecommitdiffstats
path: root/SCons
diff options
context:
space:
mode:
authorJoseph Brill <48932340+jcbrill@users.noreply.github.com>2024-10-07 20:57:59 (GMT)
committerJoseph Brill <48932340+jcbrill@users.noreply.github.com>2024-10-07 20:57:59 (GMT)
commit9e7f85a8e79058191d93122e4b7d3d22dae969b2 (patch)
tree26a8c360ad746bda458a62e7d7bcee7b33110739 /SCons
parent4af253800fbb03751e1b4537f1362a09dcfeef8a (diff)
downloadSCons-9e7f85a8e79058191d93122e4b7d3d22dae969b2.zip
SCons-9e7f85a8e79058191d93122e4b7d3d22dae969b2.tar.gz
SCons-9e7f85a8e79058191d93122e4b7d3d22dae969b2.tar.bz2
Fix MSVS tests and minor changes to Tool/msvs.py.
testing/framework/TestSConsMSVS.py: * Add default project GUID * Pass MSVS_PROJECT_GUID via environment * Add AdditionalOptions Condition to expected vcx project file * Fix vs version number for vc version 14.3 * Fix expected platform toolset version SCons/Tool/msvs.py: * User environment MSVS_PROJECT_GUID when creating project files info * Fix writing Visual Studio 15 for VS2015 * Add .vcxprof as an expected suffix for assigning the name to the file base name Fix early exit after vc version 8.0 (exit at the end of first loop execution) in: * test/MSVS/vs-files.py * test/MSVS/vs-scc-files.py * test/MSVS/vs-scc-legacy-files.py * test/MSVS/vs-variant_dir.py Tests: * Modify tests using TestSConsMSVS to add MSVS_PROJECT_GUID to the environment in the generated SConstruct/SConscript files. * Fix: delete env['PYTHON_ROOT'] before next loop iteration in test/MSVS/vs-files.py.
Diffstat (limited to 'SCons')
-rw-r--r--SCons/Tool/msvs.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/SCons/Tool/msvs.py b/SCons/Tool/msvs.py
index 1297448..eff1c8e 100644
--- a/SCons/Tool/msvs.py
+++ b/SCons/Tool/msvs.py
@@ -1554,6 +1554,7 @@ class _GenerateV7DSW(_DSWGenerator):
if not (p.platform in seen or seen.add(p.platform))]
def GenerateProjectFilesInfo(self) -> None:
+ project_guid = self.env.get('MSVS_PROJECT_GUID', '')
for dspfile in self.dspfiles:
dsp_folder_path, name = os.path.split(dspfile)
dsp_folder_path = os.path.abspath(dsp_folder_path)
@@ -1565,8 +1566,12 @@ class _GenerateV7DSW(_DSWGenerator):
dsp_relative_file_path = name
else:
dsp_relative_file_path = os.path.join(dsp_relative_folder_path, name)
+ if not project_guid:
+ guid = _generateGUID(dspfile, '')
+ else:
+ guid = project_guid
dspfile_info = {'NAME': name,
- 'GUID': _generateGUID(dspfile, ''),
+ 'GUID': guid,
'FOLDER_PATH': dsp_folder_path,
'FILE_PATH': dspfile,
'SLN_RELATIVE_FOLDER_PATH': dsp_relative_folder_path,
@@ -1615,7 +1620,7 @@ class _GenerateV7DSW(_DSWGenerator):
elif self.version_num >= 14.2:
# Visual Studio 2019 is considered to be version 16.
self.file.write('# Visual Studio 16\n')
- elif self.version_num > 14.0:
+ elif self.version_num >= 14.0:
# Visual Studio 2015 and 2017 are both considered to be version 15.
self.file.write('# Visual Studio 15\n')
elif self.version_num >= 12.0:
@@ -1632,7 +1637,7 @@ class _GenerateV7DSW(_DSWGenerator):
for dspinfo in self.dspfiles_info:
name = dspinfo['NAME']
base, suffix = SCons.Util.splitext(name)
- if suffix == '.vcproj':
+ if suffix in ('.vcxproj', '.vcproj'):
name = base
self.file.write('Project("%s") = "%s", "%s", "%s"\n'
% (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID']))