summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorDoekin <[email protected]>2025-03-22 23:06:05 +0800
committerDoekin <[email protected]>2025-03-22 23:06:05 +0800
commit2190152114f50bb140f3bb3572264914a32006c1 (patch)
treed646911b6254bd2e2e7eb9741504d8a038a1499b /xmake/modules/package/tools/cmake.lua
parent8ed7230306285162bf36aca054a30ac8258e05f7 (diff)
package(cmake): fix incorrect flag handling caused by substring matching
Resolved an issue where flags were mistakenly considered added due to substring matching (e.g., `CMAKE_CXX_FLAGS` being a part of `CMAKE_CXX_FLAGS_RELWITHDEBINFO`). This prevented certain flags from being properly included in the cmake command line. Improved the logic to ensure accurate flag detection and inclusion.
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index fab2d0ff4..c0f86a95e 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -390,7 +390,7 @@ function _insert_configs_from_envs(configs, envs, opt)
opt = opt or {}
local configs_str = opt._configs_str
for k, v in pairs(envs) do
- if configs_str and configs_str:find(k, 1, true) then
+ if configs_str and configs_str:find("-D" .. k .. "=", 1, true) then
-- use user custom configuration
else
table.insert(configs, "-D" .. k .. "=" .. v)