On 10/08/2015 04:01, Stefan wrote:
Hi,
attached are patches for SVN 1.7, 1.8, 1.9 and trunk which correct the
ToolsVersion-setting in the generated project/filter files for VS >=
2010.
As of VS 2013 the ToolsVersion is no longer statically set to 4.0, but
rather to the correct toolset version (see:
https://msdn.microsoft.com/en-us/library/bb383796.aspx).
While I'm not aware of any concrete issue here, for the sake of
correctness I believe this to be a patch which is worth applying to
1.7+ (so that the in 1.7.21 mentioned VS 2015 is "as correct as
possible").
The patch for 1.7 also drops a redundant entry from gen_win.py (the
VS2010 entry was specified twice there).
1.7:
[[
Sets the ToolsVersion value correctly in the VS project files for VS
>= 2013.
Also drops a redundant entry for VS2010.
* build/generator/gen_vcnet_vcproj.py:
(write_project): add data.tools_version
* build/generator/gen_win.py:
(parse_options): remove redundant VS 2010 section and specify
values for
tools_version
(move_proj_file): copy tools_version to data
* build/generator/templates/neon.vcxproj.ezt
* build/generator/templates/serf.vcxproj.ezt
* build/generator/templates/svn_config.vcxproj.ezt
* build/generator/templates/svn_locale.vcxproj.ezt
* build/generator/templates/vcnet_vcxproj.ezt
* build/generator/templates/vcnet_vcxproj_filters.ezt
* build/generator/templates/zlib.vcxproj.ezt
(): set ToolsVersion to VS version specific value
]]
1.8:
[[
Sets the ToolsVersion value correctly in the VS project files for VS
>= 2013.
* build/generator/gen_vcnet_vcproj.py:
(write_project): add data.tools_version
* build/generator/gen_win.py:
(parse_options): specify values for tools_version
(move_proj_file): copy tools_version to data
* build/generator/templates/serf.vcxproj.ezt
* build/generator/templates/svn_config.vcxproj.ezt
* build/generator/templates/svn_locale.vcxproj.ezt
* build/generator/templates/vcnet_vcxproj.ezt
* build/generator/templates/vcnet_vcxproj_filters.ezt
* build/generator/templates/zlib.vcxproj.ezt
(): set ToolsVersion to VS version specific value
]]
1.9+trunk:
[[
Sets the ToolsVersion value correctly in the VS project files for VS
>= 2013.
* build/generator/gen_vcnet_vcproj.py:
(write_project): add data.tools_version
* build/generator/gen_win.py:
(move_proj_file): copy tools_version to data
* build/generator/gen_win_dependencies.py:
(parse_options): specify values for tools_version
* build/generator/templates/svn_config.vcxproj.ezt
* build/generator/templates/svn_locale.vcxproj.ezt
* build/generator/templates/vcnet_vcxproj.ezt
* build/generator/templates/vcnet_vcxproj_filters.ezt
(): set ToolsVersion to VS version specific value
]]
Regards,
Stefan
Attached is a corrected patch for trunk (last one contained an
unintentional change in INSTALL).
Regards,
Stefan
Index: build/generator/gen_vcnet_vcproj.py
===================================================================
--- build/generator/gen_vcnet_vcproj.py (revision 1694925)
+++ build/generator/gen_vcnet_vcproj.py (working copy)
@@ -131,6 +131,7 @@
'instrument_apr_pools' : self.instrument_apr_pools,
'instrument_purify_quantify' : self.instrument_purify_quantify,
'version' : self.vcproj_version,
+ 'tools_version' : self.tools_version,
'toolset_version' : 'v' + self.vcproj_version.replace('.',''),
}
Index: build/generator/gen_win.py
===================================================================
--- build/generator/gen_win.py (revision 1694925)
+++ build/generator/gen_win.py (working copy)
@@ -959,6 +959,7 @@
'version' : self.vcproj_version,
'configs' : self.configs,
'platforms' : self.platforms,
+ 'tools_version' : self.tools_version,
'toolset_version' : 'v' + self.vcproj_version.replace('.',''),
}
for key, val in params:
Index: build/generator/gen_win_dependencies.py
===================================================================
--- build/generator/gen_win_dependencies.py (revision 1694925)
+++ build/generator/gen_win_dependencies.py (working copy)
@@ -243,21 +243,25 @@
self.vs_version = '2010'
self.sln_version = '11.00'
self.vcproj_version = '10.0'
+ self.tools_version = '4.0'
self.vcproj_extension = '.vcxproj'
elif val == '2012' or val == '11':
self.vs_version = '2012'
self.sln_version = '12.00'
self.vcproj_version = '11.0'
+ self.tools_version = '4.0'
self.vcproj_extension = '.vcxproj'
elif val == '2013' or val == '12':
self.vs_version = '2013'
self.sln_version = '12.00'
self.vcproj_version = '12.0'
+ self.tools_version = '12.0'
self.vcproj_extension = '.vcxproj'
elif val == '2015' or val == '14':
self.vs_version = '2015'
self.sln_version = '12.00'
self.vcproj_version = '14.0'
+ self.tools_version = '14.0'
self.vcproj_extension = '.vcxproj'
elif re.match('^20\d+$', val):
print('WARNING: Unknown VS.NET version "%s",'
@@ -265,11 +269,13 @@
self.vs_version = '2012'
self.sln_version = '12.00'
self.vcproj_version = '11.0'
+ self.tools_version = '4.0'
self.vcproj_extension = '.vcxproj'
elif re.match('^1\d+$', val):
self.vs_version = val
self.sln_version = '12.00'
self.vcproj_version = val + '.0'
+ self.tools_version = val + '.0'
self.vcproj_extension = '.vcxproj'
else:
print('WARNING: Unknown VS.NET version "%s",'
Index: build/generator/templates/svn_config.vcxproj.ezt
===================================================================
--- build/generator/templates/svn_config.vcxproj.ezt (revision 1694925)
+++ build/generator/templates/svn_config.vcxproj.ezt (working copy)
@@ -18,7 +18,7 @@
under the License.
-->
]<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="[tools_version]" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
[for configs][for platforms] <ProjectConfiguration Include="[configs]|[platforms]">
<Configuration>[configs]</Configuration>
Index: build/generator/templates/svn_locale.vcxproj.ezt
===================================================================
--- build/generator/templates/svn_locale.vcxproj.ezt (revision 1694925)
+++ build/generator/templates/svn_locale.vcxproj.ezt (working copy)
@@ -18,7 +18,7 @@
under the License.
-->
[end]<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="[tools_version]" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
[for configs][for platforms] <ProjectConfiguration Include="[configs]|[platforms]">
<Configuration>[configs]</Configuration>
Index: build/generator/templates/vcnet_vcxproj.ezt
===================================================================
--- build/generator/templates/vcnet_vcxproj.ezt (revision 1694925)
+++ build/generator/templates/vcnet_vcxproj.ezt (working copy)
@@ -18,7 +18,7 @@
under the License.
-->
]<?xml version="1.0" encoding="utf-8"?>
-[format "xml"]<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+[format "xml"]<Project DefaultTargets="Build" ToolsVersion="[tools_version]" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
[for platforms][for configs] <ProjectConfiguration Include="[configs.name]|[platforms]">
<Configuration>[configs.name]</Configuration>
Index: build/generator/templates/vcnet_vcxproj_filters.ezt
===================================================================
--- build/generator/templates/vcnet_vcxproj_filters.ezt (revision 1694925)
+++ build/generator/templates/vcnet_vcxproj_filters.ezt (working copy)
@@ -18,7 +18,7 @@
under the License.
-->
]<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="[tools_version]" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{b21a2522-2044-4342-af26-ca29509f90e7}</UniqueIdentifier>