Skip to content

Commit ec46b85

Browse files
committed
fix cmake flags #6781
1 parent a553f8c commit ec46b85

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

xmake/modules/package/tools/cmake.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,11 @@ end
941941
function _get_configs(package, configs, opt)
942942
configs = configs or {}
943943
opt._configs_str = string.serialize(configs, {indent = false, strip = true})
944+
945+
-- we need to get the default flags first to avoid being overwritten.
946+
-- @see https://github.com/xmake-io/xmake/issues/6781
947+
local envs = _get_envs_for_default_flags(package, configs, opt)
948+
944949
_get_configs_for_install(package, configs, opt)
945950
_get_configs_for_generator(package, configs, opt)
946951
if package:is_plat("windows") then
@@ -975,7 +980,6 @@ function _get_configs(package, configs, opt)
975980
table.insert(configs, "-DCMAKE_POLICY_VERSION_MINIMUM=3.5")
976981
end
977982

978-
local envs = _get_envs_for_default_flags(package, configs, opt)
979983
local runtime_envs = _get_envs_for_runtime_flags(package, configs, opt)
980984
if runtime_envs then
981985
envs = envs or {}

0 commit comments

Comments
 (0)