Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何明確使用指定的Windows SDK版本 #250

Closed
orzuk-lmj opened this issue Nov 8, 2018 · 4 comments
Closed

如何明確使用指定的Windows SDK版本 #250

orzuk-lmj opened this issue Nov 8, 2018 · 4 comments

Comments

@orzuk-lmj
Copy link
Contributor

假如我的win10內同時裝了兩個以上的windows sdk,例如擁有了以下的版本號:
target platform version
10.0.10586.0
10.0.15063.0
現在執行 xmake -f 或是 xmake project -k vs2015 之後,貌似都會直接使用最新的 10.0.15063.0 版。
如果有相容性需求,必須得用特定版號,請問有什麼建議呢?

@waruqi
Copy link
Member

waruqi commented Nov 8, 2018

目前是自动探测后,使用最新的版本,暂时还不支持手动配置,但是你可以在生成的vcproj后,打开vs自己到设置里面切换下版本再编译就行了。。

后期有时间我会考虑加上这个设置,请耐心等待。。。

@waruqi waruqi added this to the v2.2.3 milestone Nov 10, 2018
@waruqi
Copy link
Member

waruqi commented Nov 16, 2018

我加了一个命令行参数来设置这个,你可以试试: https://github.com/tboox/xmake/releases/download/v2.2.2/xmake-v2.2.3-dev.exe

$ xmake f --vs_sdkver=10.0.15063.0 -c
$ xmake project -k vs2015

@orzuk-lmj
Copy link
Contributor Author

orzuk-lmj commented Nov 16, 2018

感謝添加這個細節,非常的實用。
另外想問一下,原代碼中有些看不太懂,不理解 sdkver 怎麼轉出來的,傳入的時候不是有帶vs_字首嗎?

-- Tools\xmake\bin\modules\detect\sdks\find_vstudio.lua
,  {nil, "vs_toolset", "kv", nil,    "The Microsoft Visual Studio Toolset Version", "  .e.g --vs_toolset=14.0"                    }
,  {nil, "vs_sdkver",  "kv", nil,    "The Windows SDK Version of Visual Studio" ,   "  .e.g --vs_sdkver=10.0.15063.0"             }
-- Tools\xmake\bin\platforms\windows\xmake.lua
    local vcvarsall_x86 = _load_vcvarsall(vcvarsall, "x86", opt.vcvars_ver, opt.sdkver)
    local vcvarsall_x64 = _load_vcvarsall(vcvarsall, "x64", opt.vcvars_ver, opt.sdkver)

@waruqi
Copy link
Member

waruqi commented Nov 16, 2018

哦,我忘记传递了,这边没有两个以上的sdk环境,所以没怎么测过。。你先重下下载更新下 试试吧。。安装包我更新过了。。

@waruqi waruqi closed this as completed Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants