summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-05-03 00:48:15 +0800
committerruki <[email protected]>2023-05-03 00:48:15 +0800
commit9dee54ceb13907227b61ee434dd761dfba996fa4 (patch)
treea59f7f6f05a778c48d134a84e56ba4926a3be7be
parenta3b4b157db9eab2a98929429952e9ec4b05a9ebf (diff)
improve msvc for conan2
-rw-r--r--xmake/modules/package/manager/conan/v2/install_package.lua18
1 files changed, 8 insertions, 10 deletions
diff --git a/xmake/modules/package/manager/conan/v2/install_package.lua b/xmake/modules/package/manager/conan/v2/install_package.lua
index 399665136..cd8b7c7a0 100644
--- a/xmake/modules/package/manager/conan/v2/install_package.lua
+++ b/xmake/modules/package/manager/conan/v2/install_package.lua
@@ -154,17 +154,15 @@ function _conan_generate_compiler_profile(profile, configs, opt)
local plat = opt.plat
local arch = opt.arch
if plat == "windows" then
- local vsvers = {["2022"] = "17",
- ["2019"] = "16",
- ["2017"] = "15",
- ["2015"] = "14",
- ["2013"] = "12",
- ["2012"] = "11",
- ["2010"] = "10",
- ["2008"] = "9",
- ["2005"] = "8"}
+ -- https://github.com/conan-io/conan/blob/353c63b16c31c90d370305b5cbb5dc175cf8a443/conan/tools/microsoft/visual.py#L13
+ local vsvers = {["2022"] = "193",
+ ["2019"] = "192",
+ ["2017"] = "191",
+ ["2015"] = "190",
+ ["2013"] = "180",
+ ["2012"] = "170"}
local vs = assert(config.get("vs"), "vs not found!")
- profile:print("compiler=Visual Studio")
+ profile:print("compiler=msvc")
profile:print("compiler.version=" .. assert(vsvers[vs], "unknown msvc version!"))
if configs.vs_runtime then
profile:print("compiler.runtime=" .. configs.vs_runtime)