From 813e10fd6cb29ca692e2994b54a1ea39a1b48a19 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Thu, 24 Feb 2022 21:54:31 +0800 Subject: improve cmake generator --- xmake/plugins/project/cmake/cmakelists.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index 925a4659c..7b1fe3167 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -65,8 +65,7 @@ end function _get_project_languages(targets) local languages = {} for _, target in pairs(targets) do - for _, sourcebatch in pairs(target:sourcebatches()) do - local sourcekind = sourcebatch.sourcekind + for _, sourcekind in ipairs(target:sourcekinds()) do if sourcekind == "cc" then table.insert(languages, "C") elseif sourcekind == "cxx" then table.insert(languages, "CXX") elseif sourcekind == "as" then table.insert(languages, "ASM") -- cgit v1.3.1