aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-11-16 07:57:44 +0100
committerPierre Ossman <ossman@cendio.se>2023-01-10 19:41:13 +0100
commite78ebbcb19724491e9ad69ce9bf463161128678f (patch)
tree060073396986924afa74722c3e06445584fabfa5 /cmake
parent651e7633381453e7a33052b23b1a85b6d81b4449 (diff)
downloadtigervnc-e78ebbcb19724491e9ad69ce9bf463161128678f.tar.gz
tigervnc-e78ebbcb19724491e9ad69ce9bf463161128678f.zip
Fall back to dynamic libraries in .la files
This is what the linker does, so we should do the same for correct behaviour.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CMakeMacroLibtoolFile.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake
index 14951285..1115c0d3 100644
--- a/cmake/Modules/CMakeMacroLibtoolFile.cmake
+++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake
@@ -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)