Fix combine_static_libs macro
authorTimo Röhling <roehling@debian.org>
Sat, 23 Oct 2021 17:19:52 +0000 (19:19 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Sun, 27 Feb 2022 15:24:21 +0000 (15:24 +0000)
Gbp-Pq: Name 0004-Fix-combine_static_libs-macro.patch

CMakeLists.txt

index b6cd7ab9ac316ff3c16317506d74e955afe4de71..6786b228dd8ccff620fc335c66d81785f34f47aa 100644 (file)
@@ -495,7 +495,12 @@ function(combine_static_libs TARGET OUTPUT DEPS)
     # Loop through the dependent libraries and query their location on disk.
     set(DEPS_FILES )
     foreach(DEPENDENCY ${DEPS})
-        list(APPEND DEPS_FILES "$<TARGET_FILE:${DEPENDENCY}>")
+        if(TARGET ${DEPENDENCY})
+            get_property(dep_type TARGET ${DEPENDENCY} PROPERTY TYPE)
+            if(dep_type STREQUAL "STATIC_LIBRARY")
+                list(APPEND DEPS_FILES "$<TARGET_FILE:${DEPENDENCY}>")
+            endif()
+        endif()
     endforeach()
 
     add_custom_command(