Skip to content

Commit f612170

Browse files
authored
Merge pull request #5569 from xmake-io/conan
add build settings for conan
2 parents c9c01c9 + af3f8a0 commit f612170

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

xmake/modules/package/manager/conan/configurations.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ function main()
2525
build = {description = "Use it to choose if you want to build from sources.", default = "missing", values = {"all", "never", "missing", "outdated"}},
2626
remote = {description = "Set the conan remote server."},
2727
options = {description = "Set the options values, e.g. shared=True"},
28-
settings = {description = "Set the build settings for conan."},
28+
settings = {description = "Set the host settings for conan."},
29+
settings_host = {description = "Set the host settings for conan."},
30+
settings_build = {description = "Set the build settings for conan."},
2931
imports = {description = "Set the imports for conan 1.x, it has been deprecated in conan 2.x."},
3032
build_requires = {description = "Set the build requires for conan."}
3133
}

xmake/modules/package/manager/conan/v2/install_package.lua

+8-2
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,18 @@ function main(conan, name, opt)
321321
end
322322
end
323323

324-
-- set custom settings
325-
for _, setting in ipairs(configs.settings) do
324+
-- set custom host settings
325+
for _, setting in ipairs(configs.settings or configs.settings_host) do
326326
table.insert(argv, "-s")
327327
table.insert(argv, setting)
328328
end
329329

330+
-- set custom build settings
331+
for _, setting in ipairs(configs.settings_build) do
332+
table.insert(argv, "-s:b")
333+
table.insert(argv, setting)
334+
end
335+
330336
-- set remote
331337
if configs.remote then
332338
table.insert(argv, "-r")

0 commit comments

Comments
 (0)