summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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")