vcpkg/ports/libpng/libm.patch

18 lines
568 B
Diff
Raw Normal View History

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbd31d7..7deb6c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,6 +109,12 @@ elseif(POLICY CMP0074)
endif()
if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU AND NOT EMSCRIPTEN)
+ block(SCOPE_FOR VARIABLES)
+ if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ list(PREPEND CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ endif()
+ find_library(M_LIBRARY m PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
+ endblock()
find_library(M_LIBRARY m)
if(M_LIBRARY)
set(M_LIBRARY m)