summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormclee <[email protected]>2019-11-22 17:16:02 +0800
committermclee <[email protected]>2019-11-22 17:16:02 +0800
commit28a908469c7cedc5975afe5ac4503e884968dd0c (patch)
tree8cd3988aa203a5e4613f5144900c89d5f2576030
parent434c6d5aed8cb6d2764a4b9f30bde35fc306bcb8 (diff)
get correct windows sdk version for vsxmake plugin
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua8
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj1
2 files changed, 8 insertions, 1 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 149df6721..33c514a9a 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -141,6 +141,7 @@ function _make_targetinfo(mode, arch, target)
, arch = arch
, plat = config.get("plat")
, vsarch = (arch == "x86" and "Win32" or arch)
+ , sdkver = config.get("vs_sdkver")
}
-- write only if not default
@@ -171,6 +172,9 @@ function _make_targetinfo(mode, arch, target)
for k, v in pairs(configcache:get("options_" .. target:name())) do
if k ~= "plat" and k ~= "mode" and k ~= "arch" and k ~= "clean" and k ~= "buildir" then
table.insert(flags, "--" .. k .. "=" .. tostring(v));
+ if k == "vs_sdkver" then
+ targetinfo.sdkver = tostring(v)
+ end
end
end
targetinfo.configflags = os.args(flags)
@@ -344,7 +348,9 @@ function main(outputdir, vsinfo)
if tgtdir then _target.targetdir = path.relative(tgtdir, _target.vcxprojdir) end
_target._sub = _target._sub or {}
_target._sub[mode] = _target._sub[mode] or {}
- _target._sub[mode][arch] = _make_targetinfo(mode, arch, target)
+ local tgtinfo = _make_targetinfo(mode, arch, target)
+ _target._sub[mode][arch] = tgtinfo
+ _target.sdkver = tgtinfo.sdkver
-- save all sourcefiles and headerfiles
_target.sourcefiles = table.unique(table.join(_target.sourcefiles or {}, (target:sourcefiles())))
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj
index 9083dc278..323ed1a25 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/#target#.vcxproj
@@ -22,6 +22,7 @@
<XmakeProjectDir>#projectdir#</XmakeProjectDir>
<XmakeProjectFile>#projectfile#</XmakeProjectFile>
<XmakeTarget>#target#</XmakeTarget>
+ <WindowsTargetPlatformVersion>#sdkver#</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="XmakeProgram">
<XmakeProgramDir Condition="'$(XmakeProgramDir)' == ''">$(XMAKE_PROGRAM_DIR)</XmakeProgramDir>