summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index 788d3caf8..52820620a 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -40,8 +40,6 @@ function _get_cmake_version()
local cmake = find_tool("cmake", {version = true})
if cmake and cmake.version then
cmake_version = semver.new(cmake.version)
- else
- cmake_version = semver.new("3.23")
end
_g.cmake_version = cmake_version
end
@@ -463,7 +461,8 @@ end
function _print_target_sources(cmakelists, target, files, visibility, opt)
opt = opt or {}
- local has_fileset_support = _get_cmake_version():ge("3.23")
+ local cmake_version = _get_cmake_version()
+ local has_fileset_support = cmake_version and cmake_version:ge("3.23")
local fileset = ""
if has_fileset_support and opt.set then
fileset = "FILE_SET " .. opt.set .. " FILES"