summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorShrBox <[email protected]>2026-04-10 19:27:47 +0800
committerShrBox <[email protected]>2026-04-10 19:27:47 +0800
commit866232dce27bf3e97b29fd157472a0ef9f030a7a (patch)
tree9dc6cd3b5b6b17fbce46591e36b7d83d81322913 /xmake/plugins
parent7be3d4a277469881ea7c2403e28885c7f8605c5f (diff)
fix(cmakelists): use target_link_libraries to link object libraries
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/cmake/cmakelists.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua
index d089cf805..790f34d4d 100644
--- a/xmake/plugins/project/cmake/cmakelists.lua
+++ b/xmake/plugins/project/cmake/cmakelists.lua
@@ -1089,21 +1089,22 @@ function _add_target_link_libraries(cmakelists, target, outputdir)
cmakelists:print(" " .. _get_relative_unix_path_to_cmake(objectfile, outputdir))
end
end
+ cmakelists:print(")")
end
if #object_deps ~= 0 then
if not has_links then
cmakelists:print("add_library(target_objectfiles_%s OBJECT IMPORTED GLOBAL)", key)
- cmakelists:print("set_property(TARGET target_objectfiles_%s PROPERTY IMPORTED_OBJECTS", key)
has_links = true
end
+ cmakelists:print("target_link_libraries(target_objectfiles_%s INTERFACE", key)
for _, dep in ipairs(object_deps) do
cmakelists:print(" " .. dep)
end
+ cmakelists:print(")")
end
if has_links then
- cmakelists:print(")")
cmakelists:print("target_link_libraries(%s PRIVATE target_objectfiles_%s)", target:name(), key)
end
end