mirror of
https://github.com/glfw/glfw.git
synced 2025-06-17 21:17:42 +00:00
Merge 4d7ddae70c
into e7ea71be03
This commit is contained in:
commit
87d003309a
@ -129,7 +129,7 @@ if (GLFW_INSTALL)
|
||||
# Only generate this target if no higher-level project already has
|
||||
if (NOT TARGET uninstall)
|
||||
configure_file(CMake/cmake_uninstall.cmake.in
|
||||
cmake_uninstall.cmake IMMEDIATE @ONLY)
|
||||
cmake_uninstall.cmake @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
"${CMAKE_COMMAND}" -P
|
||||
|
@ -3,7 +3,7 @@ link_libraries(glfw)
|
||||
|
||||
include_directories("${GLFW_SOURCE_DIR}/deps")
|
||||
|
||||
if (MATH_LIBRARY)
|
||||
if (NOT MATH_LIBRARY STREQUAL "MATH_LIBRARY-NOTFOUND")
|
||||
link_libraries("${MATH_LIBRARY}")
|
||||
endif()
|
||||
|
||||
@ -38,7 +38,7 @@ add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD_GL})
|
||||
add_executable(windows WIN32 MACOSX_BUNDLE windows.c ${ICON} ${GLAD_GL})
|
||||
|
||||
target_link_libraries(particles Threads::Threads)
|
||||
if (RT_LIBRARY)
|
||||
if (NOT RT_LIBRARY STREQUAL "RT_LIBRARY-NOTFOUND")
|
||||
target_link_libraries(particles "${RT_LIBRARY}")
|
||||
endif()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
@ -312,7 +314,7 @@ if (GLFW_BUILD_SHARED_LIBRARY)
|
||||
# Compatibility with data execution prevention (DEP)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
|
||||
check_c_compiler_flag("" _GLFW_HAS_DEP)
|
||||
check_c_source_compiles("int main() { return 0; }" _GLFW_HAS_DEP)
|
||||
if (_GLFW_HAS_DEP)
|
||||
target_link_libraries(glfw PRIVATE "-Wl,--nxcompat")
|
||||
endif()
|
||||
@ -321,7 +323,7 @@ if (GLFW_BUILD_SHARED_LIBRARY)
|
||||
# Compatibility with address space layout randomization (ASLR)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
|
||||
check_c_compiler_flag("" _GLFW_HAS_ASLR)
|
||||
check_c_source_compiles("int main() { return 0; }" _GLFW_HAS_ASLR)
|
||||
if (_GLFW_HAS_ASLR)
|
||||
target_link_libraries(glfw PRIVATE "-Wl,--dynamicbase")
|
||||
endif()
|
||||
@ -330,7 +332,7 @@ if (GLFW_BUILD_SHARED_LIBRARY)
|
||||
# Compatibility with 64-bit address space layout randomization (ASLR)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
|
||||
check_c_compiler_flag("" _GLFW_HAS_64ASLR)
|
||||
check_c_source_compiles("int main() { return 0; }" _GLFW_HAS_64ASLR)
|
||||
if (_GLFW_HAS_64ASLR)
|
||||
target_link_libraries(glfw PRIVATE "-Wl,--high-entropy-va")
|
||||
endif()
|
||||
|
@ -3,7 +3,7 @@ link_libraries(glfw)
|
||||
|
||||
include_directories("${GLFW_SOURCE_DIR}/deps")
|
||||
|
||||
if (MATH_LIBRARY)
|
||||
if (NOT MATH_LIBRARY STREQUAL "MATH_LIBRARY-NOTFOUND")
|
||||
link_libraries("${MATH_LIBRARY}")
|
||||
endif()
|
||||
|
||||
@ -43,7 +43,7 @@ add_executable(window WIN32 MACOSX_BUNDLE window.c ${GLAD_GL})
|
||||
|
||||
target_link_libraries(empty Threads::Threads)
|
||||
target_link_libraries(threads Threads::Threads)
|
||||
if (RT_LIBRARY)
|
||||
if (NOT RT_LIBRARY STREQUAL "RT_LIBRARY-NOTFOUND")
|
||||
target_link_libraries(empty "${RT_LIBRARY}")
|
||||
target_link_libraries(threads "${RT_LIBRARY}")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user