diff options
| author | ruki <[email protected]> | 2025-09-14 21:25:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-14 21:25:43 +0800 |
| commit | ec46b858be4de1a09802ced44ea8e2860edd093a (patch) | |
| tree | 4fe5650d09d9d4c38e89894f1962a61782b7f6f3 | |
| parent | a553f8cf189239aa152644cddcb4d0e1fbd0f8ec (diff) | |
fix cmake flags #6781
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 6 |
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 {} |
