summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2025-06-25 22:19:10 +0800
committerstar9029 <[email protected]>2025-06-25 22:19:10 +0800
commitd97dcb8e4c413b914d842ef931914b6f3574d13e (patch)
tree1c6129d5dc240cf1cda2e40cc7c65f42e7cdfab3 /xmake/modules/package/tools/cmake.lua
parentac40f478b8e03306b788d28c8882d2197d37fdf6 (diff)
Fix attempt to index a nil value
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 5e3afa08b..feaf6d7ff 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -851,7 +851,7 @@ function _get_default_flags(package, configs, buildtype, opt)
local cmake = find_tool("cmake")
local _configs = table.join(configs, "-S " .. path.directory(dummy_cmakelist), "-B " .. tmpdir)
local outdata = try{ function() return os.iorunv(cmake.program, _configs, {envs = runenvs}) end}
- if outdata then
+ if outdata and outdata ~= "" then
cmake_default_flags = {}
cmake_default_flags.cflags = outdata:match("CMAKE_C_FLAGS is (.-)\n") or " "
cmake_default_flags.cflags = cmake_default_flags.cflags .. " " .. outdata:match(format("CMAKE_C_FLAGS_%s is (.-)\n", buildtype)):replace("/MDd", ""):replace("/MD", "")