summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-02-07 18:34:46 +0100
committerArthur LAURENT <[email protected]>2024-02-07 18:35:43 +0100
commite721aae44e6b8fbfd8b6434bffbdf5279259af96 (patch)
tree21f12812d45ee0f4f2d42ad1cadb529064bc9d7f
parent5d088711452a880de0a101e1d1759207eac1cf68 (diff)
implement basic cmake support for moduleonly
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index a91328d54..723b80b33 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -323,6 +323,11 @@ function _add_target_headeronly(cmakelists, target)
cmakelists:print("add_library(%s INTERFACE)", target:name())
end
+-- add target: headeronly
+function _add_target_moduleonly(cmakelists, target)
+ cmakelists:print("add_library(%s INTERFACE)", target:name())
+end
+
-- add target dependencies
function _add_target_dependencies(cmakelists, target)
local deps = target:get("deps")
@@ -1003,8 +1008,8 @@ function _add_target(cmakelists, target, outputdir)
_add_target_headeronly(cmakelists, target)
_add_target_include_directories(cmakelists, target, outputdir)
return
- elseif targetkind == 'moduleonly' then
- raise("target kind moduleonly is currently not supported for cmakelists")
+ elseif targetkind == 'headeronly' then
+ _add_target_moduleonly(cmakelists, target)
else
raise("unknown target kind %s", target:kind())
end