]> source.dussan.org Git - tigervnc.git/commitdiff
Fall back to dynamic libraries in .la files
authorPierre Ossman <ossman@cendio.se>
Wed, 16 Nov 2022 06:57:44 +0000 (07:57 +0100)
committerPierre Ossman <ossman@cendio.se>
Tue, 10 Jan 2023 18:41:13 +0000 (19:41 +0100)
This is what the linker does, so we should do the same for correct
behaviour.

cmake/Modules/CMakeMacroLibtoolFile.cmake

index 14951285b3e3e2e76bf0ea79cd3ebcc8524bb62c..1115c0d36507927400fc65d9486cdb6b0fa0e870 100644 (file)
@@ -89,15 +89,19 @@ macro(libtool_create_control_file _target)
           endif()
 
           if(STATIC_MODE)
-            set(library ${CMAKE_STATIC_LIBRARY_PREFIX}${library}${CMAKE_STATIC_LIBRARY_SUFFIX})
+            set(_library ${CMAKE_STATIC_LIBRARY_PREFIX}${library}${CMAKE_STATIC_LIBRARY_SUFFIX})
+            find_library(FL ${_library} PATHS ${LIBRARY_PATHS})
+          endif()
+
+          if(NOT FL)
+            find_library(FL ${library} PATHS ${LIBRARY_PATHS})
           endif()
 
-          find_library(FL ${library} PATHS ${LIBRARY_PATHS})
           if(FL)
             # Found library. Depending on if it's static or not we might
             # extract the path and library name, then add the
             # result to the libtool dependency libs.
-            if(STATIC_MODE)
+            if("${FL}" MATCHES ".+${CMAKE_STATIC_LIBRARY_SUFFIX}$")
               set(_target_dependency_libs "${_target_dependency_libs} ${FL}")
             else()
               get_filename_component(_shared_lib ${FL} NAME_WE)