diff --git a/xmake/modules/package/manager/conan/configurations.lua b/xmake/modules/package/manager/conan/configurations.lua index 8e03cf9a3f4..7b900b98351 100644 --- a/xmake/modules/package/manager/conan/configurations.lua +++ b/xmake/modules/package/manager/conan/configurations.lua @@ -25,7 +25,9 @@ function main() 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 build settings for conan."}, + 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."} } diff --git a/xmake/modules/package/manager/conan/v2/install_package.lua b/xmake/modules/package/manager/conan/v2/install_package.lua index 3c2a7a2c53d..f4a8de9e5b1 100644 --- a/xmake/modules/package/manager/conan/v2/install_package.lua +++ b/xmake/modules/package/manager/conan/v2/install_package.lua @@ -321,12 +321,18 @@ function main(conan, name, opt) end end - -- set custom settings - for _, setting in ipairs(configs.settings) do + -- set custom host settings + for _, setting in ipairs(configs.settings or configs.settings_host) do table.insert(argv, "-s") table.insert(argv, setting) end + -- set custom build settings + for _, setting in ipairs(configs.settings_build) do + table.insert(argv, "-s:b") + table.insert(argv, setting) + end + -- set remote if configs.remote then table.insert(argv, "-r")