summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-24 00:45:22 +0800
committerruki <[email protected]>2024-01-25 12:09:59 +0800
commita7a9aeb01e456651600b1fb8cb2b7e590036d3db (patch)
tree4deb080481daca1157426dc52e066020a4f160e5
parent3618119fe36169f63bf9c4efcad5f9802ba37581 (diff)
improve conan runtimes
-rw-r--r--xmake/modules/package/manager/conan/v2/install_package.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/modules/package/manager/conan/v2/install_package.lua b/xmake/modules/package/manager/conan/v2/install_package.lua
index bf561124e..111b355d7 100644
--- a/xmake/modules/package/manager/conan/v2/install_package.lua
+++ b/xmake/modules/package/manager/conan/v2/install_package.lua
@@ -167,6 +167,7 @@ function _conan_generate_compiler_profile(profile, configs, opt)
local conf
local plat = opt.plat
local arch = opt.arch
+ local runtimes = configs.runtimes
if plat == "windows" then
-- https://github.com/conan-io/conan/blob/353c63b16c31c90d370305b5cbb5dc175cf8a443/conan/tools/microsoft/visual.py#L13
local vsvers = {["2022"] = "193",
@@ -182,7 +183,6 @@ function _conan_generate_compiler_profile(profile, configs, opt)
if tonumber(vs) >= 2015 then
profile:print("compiler.cppstd=14")
end
- local runtimes = configs.runtimes
if runtimes then
profile:print("compiler.runtime=" .. (runtimes:startswith("MD") and "dynamic" or "static"))
profile:print("compiler.runtime_type=" .. (runtimes:endswith("d") and "Debug" or "Release"))
@@ -212,9 +212,8 @@ function _conan_generate_compiler_profile(profile, configs, opt)
if ndk_sdkver then
profile:print("os.api_level=" .. ndk_sdkver)
end
- local ndk_cxxstl = config.get("ndk_cxxstl")
- if ndk_cxxstl then
- profile:print("compiler.libcxx=" .. ndk_cxxstl)
+ if runtimes then
+ profile:print("compiler.libcxx=" .. runtimes)
end
local program, toolname = ndk:tool("cc")
local version = _conan_get_compiler_version(toolname, program)
@@ -227,9 +226,10 @@ function _conan_generate_compiler_profile(profile, configs, opt)
else
local program, toolname = platform.tool("cc", plat, arch)
if toolname == "gcc" or toolname == "clang" then
+ runtimes = table.wrap(runtimes)
profile:print("compiler=" .. toolname)
profile:print("compiler.cppstd=gnu17")
- if toolname == "clang" then
+ if table.contains(runtimes, "c++_static", "c++_shared") then
profile:print("compiler.libcxx=libc++")
else
profile:print("compiler.libcxx=libstdc++11")