xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.87k stars 776 forks source link

fixbug: config 'vs_sdkver' has no effect when generate vs project #5388

Closed jinke18 closed 2 months ago

jinke18 commented 2 months ago

config vs_sdkver

xmake f --vs_sdkver=14.0

but it has no effect when generate a vs project

xmake project -k vs2015

this pull request fix this bug~

waruqi commented 2 months ago

We shouldn't have modified it that way. First of all, 14.0 should be vs_toolset not vs_sdkver.

and

xmake f --vs_toolset/vs_sdkver -> msvc toolchain/check -> find_vstudio.lua -> get real toolset/sdkver -> generator/xmake build

so we should debug and check find_vstudio.lua

https://github.com/xmake-io/xmake/blob/71ec32ea6787c1c4b215ea40e1d5ab40c1c4eedc/xmake/toolchains/msvc/check.lua#L43

https://github.com/xmake-io/xmake/blob/71ec32ea6787c1c4b215ea40e1d5ab40c1c4eedc/xmake/modules/detect/sdks/find_vstudio.lua#L125

jinke18 commented 2 months ago

I'm sorry I made a mistake when submitting the pull request message.

it should be config vs_sdkver

xmake f --vs_sdkver=8.1
waruqi commented 2 months ago

you still need debug find_vstudio.lua, if it works, vcvars.WindowsSDKVersion will be changed to your configs after running xmake f --vs_sdkver=xxx

waruqi commented 2 months ago

You can open an issue for this patch. I will look at it.