mirror of
https://github.com/glfw/glfw.git
synced 2025-07-27 01:50:02 +00:00
Update CMakeLists.txt
check_c_source_compiles
This commit is contained in:
parent
fc89a317fc
commit
4d7ddae70c
@ -314,7 +314,7 @@ if (GLFW_BUILD_SHARED_LIBRARY)
|
|||||||
# Compatibility with data execution prevention (DEP)
|
# Compatibility with data execution prevention (DEP)
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
|
set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
|
||||||
check_linker_flag(C "-Wl,--nxcompat" _GLFW_HAS_DEP)
|
check_c_source_compiles("int main() { return 0; }" _GLFW_HAS_DEP)
|
||||||
if (_GLFW_HAS_DEP)
|
if (_GLFW_HAS_DEP)
|
||||||
target_link_libraries(glfw PRIVATE "-Wl,--nxcompat")
|
target_link_libraries(glfw PRIVATE "-Wl,--nxcompat")
|
||||||
endif()
|
endif()
|
||||||
@ -323,7 +323,7 @@ if (GLFW_BUILD_SHARED_LIBRARY)
|
|||||||
# Compatibility with address space layout randomization (ASLR)
|
# Compatibility with address space layout randomization (ASLR)
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
|
set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
|
||||||
check_linker_flag(C "-Wl,--dynamicbase" _GLFW_HAS_ASLR)
|
check_c_source_compiles("int main() { return 0; }" _GLFW_HAS_ASLR)
|
||||||
if (_GLFW_HAS_ASLR)
|
if (_GLFW_HAS_ASLR)
|
||||||
target_link_libraries(glfw PRIVATE "-Wl,--dynamicbase")
|
target_link_libraries(glfw PRIVATE "-Wl,--dynamicbase")
|
||||||
endif()
|
endif()
|
||||||
@ -332,7 +332,7 @@ if (GLFW_BUILD_SHARED_LIBRARY)
|
|||||||
# Compatibility with 64-bit address space layout randomization (ASLR)
|
# Compatibility with 64-bit address space layout randomization (ASLR)
|
||||||
cmake_push_check_state()
|
cmake_push_check_state()
|
||||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
|
set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
|
||||||
check_linker_flag(C "-Wl,--high-entropy-va" _GLFW_HAS_64ASLR)
|
check_c_source_compiles("int main() { return 0; }" _GLFW_HAS_64ASLR)
|
||||||
if (_GLFW_HAS_64ASLR)
|
if (_GLFW_HAS_64ASLR)
|
||||||
target_link_libraries(glfw PRIVATE "-Wl,--high-entropy-va")
|
target_link_libraries(glfw PRIVATE "-Wl,--high-entropy-va")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user