mirror of
https://github.com/glfw/glfw.git
synced 2025-06-05 23:34:56 +00:00
Update CMakeLists.txt
https://cmake.org/cmake/help/v3.28/variable/CMAKE_DL_LIBS.html#cmake-dl-libs https://cmake.org/cmake/help/v3.28/command/find_library.html#find-library
This commit is contained in:
parent
dc971798e8
commit
5d38860335
@ -216,21 +216,23 @@ endif()
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_library(RT_LIBRARY rt)
|
||||
mark_as_advanced(RT_LIBRARY)
|
||||
if (RT_LIBRARY)
|
||||
if (NOT RT_LIBRARY STREQUAL "RT_LIBRARY-NOTFOUND")
|
||||
target_link_libraries(glfw PRIVATE "${RT_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lrt")
|
||||
endif()
|
||||
|
||||
find_library(MATH_LIBRARY m)
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
if (MATH_LIBRARY)
|
||||
if (NOT MATH_LIBRARY STREQUAL "MATH_LIBRARY-NOTFOUND")
|
||||
target_link_libraries(glfw PRIVATE "${MATH_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lm")
|
||||
endif()
|
||||
|
||||
if (CMAKE_DL_LIBS)
|
||||
target_link_libraries(glfw PRIVATE "${CMAKE_DL_LIBS}")
|
||||
list(APPEND glfw_PKG_LIBS "-l${CMAKE_DL_LIBS}")
|
||||
find_library(DL_LIBRARY dl)
|
||||
mark_as_advanced(DL_LIBRARY)
|
||||
if (NOT DL_LIBRARY STREQUAL "DL_LIBRARY-NOTFOUND")
|
||||
target_link_libraries(glfw PRIVATE "${DL_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-ldl")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user