summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-06-03 13:57:22 +0800
committerGitHub <[email protected]>2025-06-03 13:57:22 +0800
commitc09fc2cef2c3cb3191bc8c6a74f72e2bd2dcf582 (patch)
treee44ee3f531b4e67d629b11afc14faf7b13e578e5
parent1df3b5ed4d4bec078a44ade91a8603ba375d0577 (diff)
parentb0abf262b86d9018c954b03dc2970e2191f53b06 (diff)
Merge pull request #6518 from hotaery/dev
add [conf] section to conan profile
-rw-r--r--xmake/modules/package/manager/conan/configurations.lua19
-rw-r--r--xmake/modules/package/manager/conan/v2/install_package.lua12
2 files changed, 23 insertions, 8 deletions
diff --git a/xmake/modules/package/manager/conan/configurations.lua b/xmake/modules/package/manager/conan/configurations.lua
index 7b900b983..01cc8b34c 100644
--- a/xmake/modules/package/manager/conan/configurations.lua
+++ b/xmake/modules/package/manager/conan/configurations.lua
@@ -22,14 +22,17 @@
function main()
return
{
- build = {description = "Use it to choose if you want to build from sources.", default = "missing", values = {"all", "never", "missing", "outdated"}},
- remote = {description = "Set the conan remote server."},
- options = {description = "Set the options values, e.g. shared=True"},
- settings = {description = "Set the host settings for conan."},
- 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 = {description = "Use it to choose if you want to build from sources.", default = "missing", values = {"all", "never", "missing", "outdated"}},
+ remote = {description = "Set the conan remote server."},
+ options = {description = "Set the options values, e.g. shared=True"},
+ settings = {description = "Set the host settings for conan."},
+ 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."},
+ conf = {description = "Set the host configurations for conan, e.g. tools.microsoft.bash:subsystem=msys2"},
+ conf_host = {description = "Set the host configurations for conan, e.g. tools.microsoft.bash:subsystem=msys2"},
+ conf_build = {description = "Set the build configurations for conan, 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..f93ebaea7 100644
--- a/xmake/modules/package/manager/conan/v2/install_package.lua
+++ b/xmake/modules/package/manager/conan/v2/install_package.lua
@@ -333,6 +333,18 @@ function main(conan, name, opt)
table.insert(argv, setting)
end
+ -- set custom host configurations
+ for _, conf in ipairs(configs.conf or configs.conf_host) do
+ table.insert(argv, "-c")
+ table.insert(argv, conf)
+ end
+
+ -- set custom build configurations
+ for _, conf in ipairs(configs.conf_build) do
+ table.insert(argv, "-c:b")
+ table.insert(argv, conf)
+ end
+
-- set remote
if configs.remote then
table.insert(argv, "-r")