summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-14 21:25:43 +0800
committerruki <[email protected]>2025-09-14 21:25:43 +0800
commitec46b858be4de1a09802ced44ea8e2860edd093a (patch)
tree4fe5650d09d9d4c38e89894f1962a61782b7f6f3 /xmake/modules
parenta553f8cf189239aa152644cddcb4d0e1fbd0f8ec (diff)
fix cmake flags #6781
Diffstat (limited to 'xmake/modules')
-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 {}