summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index cbf9bcb37..86754f13c 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -941,6 +941,11 @@ end
function _get_configs(package, configs, opt)
configs = configs or {}
opt._configs_str = string.serialize(configs, {indent = false, strip = true})
+
+ -- we need to get the default flags first to avoid being overwritten.
+ -- @see https://github.com/xmake-io/xmake/issues/6781
+ local envs = _get_envs_for_default_flags(package, configs, opt)
+
_get_configs_for_install(package, configs, opt)
_get_configs_for_generator(package, configs, opt)
if package:is_plat("windows") then
@@ -975,7 +980,6 @@ function _get_configs(package, configs, opt)
table.insert(configs, "-DCMAKE_POLICY_VERSION_MINIMUM=3.5")
end
- local envs = _get_envs_for_default_flags(package, configs, opt)
local runtime_envs = _get_envs_for_runtime_flags(package, configs, opt)
if runtime_envs then
envs = envs or {}