Skip to content

Commit 05b8149

Browse files
committed
improve cmakelists
1 parent c440c24 commit 05b8149

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

xmake/plugins/project/cmake/cmakelists.lua

+6-7
Original file line numberDiff line numberDiff line change
@@ -1065,20 +1065,19 @@ function _add_target(cmakelists, target, outputdir)
10651065
cmakelists:print("# target")
10661066

10671067
-- is phony target?
1068-
local targetkind = target:kind()
10691068
if target:is_phony() then
10701069
return _add_target_phony(cmakelists, target)
1071-
elseif targetkind == "binary" then
1070+
elseif target:is_binary() then
10721071
_add_target_binary(cmakelists, target, outputdir)
1073-
elseif targetkind == "static" then
1072+
elseif target:is_static() then
10741073
_add_target_static(cmakelists, target, outputdir)
1075-
elseif targetkind == "shared" then
1074+
elseif target:is_shared() then
10761075
_add_target_shared(cmakelists, target, outputdir)
1077-
elseif targetkind == 'headeronly' then
1076+
elseif target:is_headeronly() then
10781077
_add_target_headeronly(cmakelists, target)
10791078
_add_target_include_directories(cmakelists, target, outputdir)
10801079
return
1081-
elseif targetkind == 'moduleonly' then
1080+
elseif target:is_moduleonly() then
10821081
_add_target_moduleonly(cmakelists, target)
10831082
return
10841083
else
@@ -1113,7 +1112,7 @@ function _add_target(cmakelists, target, outputdir)
11131112
-- add target warnings
11141113
_add_target_warnings(cmakelists, target)
11151114

1116-
-- add target exceptions
1115+
-- add target exceptions
11171116
_add_target_exceptions(cmakelists, target)
11181117

11191118
-- add target languages

0 commit comments

Comments
 (0)