summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorharry <harry>2025-06-01 22:12:43 +0800
committerharry <harry>2025-06-01 22:14:59 +0800
commitf55d0e641559051675692bf70831598adf8bd069 (patch)
treecde5f8136eb41a6d86116b45d846dfed62edc76c
parent365df4ea412f98cdd48ebda71f2b2bbf49391445 (diff)
add [conf] section to conan profile
-rw-r--r--xmake/modules/package/manager/conan/configurations.lua3
-rw-r--r--xmake/modules/package/manager/conan/v2/install_package.lua12
2 files changed, 14 insertions, 1 deletions
diff --git a/xmake/modules/package/manager/conan/configurations.lua b/xmake/modules/package/manager/conan/configurations.lua
index 7b900b983..8742ecb6e 100644
--- a/xmake/modules/package/manager/conan/configurations.lua
+++ b/xmake/modules/package/manager/conan/configurations.lua
@@ -29,7 +29,8 @@ function main()
settings_host = {description = "Set the host settings for conan."},
settings_build = {description = "Set the build settings for conan."},
imports = {description = "Set the imports for conan 1.x, it has been deprecated in conan 2.x."},
- build_requires = {description = "Set the build requires for conan."}
+ build_requires = {description = "Set the build requires for conan."},
+ conf = {description = "Set the conan configuration, e.g. tools.microsoft.bash:subsystem=msys2"}
}
end
diff --git a/xmake/modules/package/manager/conan/v2/install_package.lua b/xmake/modules/package/manager/conan/v2/install_package.lua
index d3d109a7e..2d8bcfc86 100644
--- a/xmake/modules/package/manager/conan/v2/install_package.lua
+++ b/xmake/modules/package/manager/conan/v2/install_package.lua
@@ -248,6 +248,18 @@ function _conan_generate_compiler_profile(profile, configs, opt)
end
end
+ if configs.conf then
+ if not conf then
+ conf = {}
+ end
+ for _, pair in ipairs(configs.conf) do
+ local key, value = pair:match("([^=]+)=([^=]+)")
+ if key and value then
+ conf[key] = value
+ end
+ end
+ end
+
if conf then
profile:print("")
profile:print("[conf]")