diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index b5b6f6b26e..3002079a0a 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -1003,7 +1003,9 @@ function _add_target_link_libraries(cmakelists, target, outputdir) for _, dep in ipairs(target:orderdeps()) do if dep:is_object() then table.insert(object_deps, dep:name()) - objectfiles_set:insert(table.unpack(dep:objectfiles())) + for _, obj in ipairs(dep:objectfiles()) do + objectfiles_set:insert(obj) + end end end