Skip to content

Commit

Permalink
only set XPDeprecationWarning to false when choosing toolset v141_xp …
Browse files Browse the repository at this point in the history
…in config; add tests
  • Loading branch information
withmorten committed Apr 30, 2020
1 parent aedeb32 commit df58fd9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
36 changes: 36 additions & 0 deletions modules/vstudio/tests/vc2010/test_globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,42 @@ end
end


function suite.canSetXPDeprecationWarningToFalse_withV141XP()
toolset "v141_xp"
prepare()
test.capture [[
<PropertyGroup Label="Globals">
<ProjectGuid>{42B5DBC6-AE1F-903D-F75D-41E363076E92}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MyProject</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Globals">
<XPDeprecationWarning>false</XPDeprecationWarning>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Globals">
<XPDeprecationWarning>false</XPDeprecationWarning>
</PropertyGroup>
]]
end


function suite.canSetXPDeprecationWarningToFalse_perConfig_withV141XP()
filter "Release"
toolset "v141_xp"
prepare()
test.capture [[
<PropertyGroup Label="Globals">
<ProjectGuid>{42B5DBC6-AE1F-903D-F75D-41E363076E92}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MyProject</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Globals">
<XPDeprecationWarning>false</XPDeprecationWarning>
</PropertyGroup>
]]
end


function suite.windowsTargetPlatformVersion_latest_on2019()
p.action.set("vs2019")
systemversion "latest"
Expand Down
14 changes: 8 additions & 6 deletions modules/vstudio/vs2010_vcxproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@

m.elements.globals = function(prj)
return {
m.xpDeprecationWarning,
m.projectGuid,
m.ignoreWarnDuplicateFilename,
m.keyword,
Expand All @@ -140,6 +139,7 @@
m.elements.globalsCondition = function(prj, cfg)
return {
m.windowsTargetPlatformVersion,
m.xpDeprecationWarning,
}
end

Expand Down Expand Up @@ -2413,11 +2413,6 @@
end


function m.xpDeprecationWarning(prj)
m.element("XPDeprecationWarning", nil, "false")
end


function m.projectGuid(prj)
m.element("ProjectGuid", nil, "{%s}", prj.uuid)
end
Expand Down Expand Up @@ -2629,6 +2624,13 @@
end


function m.xpDeprecationWarning(prj, cfg)
if cfg.toolset == "msc-v141_xp" then
m.element("XPDeprecationWarning", nil, "false")
end
end


function m.preferredToolArchitecture(prj)
if _ACTION >= "vs2013" then
if prj.preferredtoolarchitecture == p.X86_64 then
Expand Down

0 comments on commit df58fd9

Please sign in to comment.