mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Remove unnecessary CMake version checks
Now that the project requires CMake version 3.15, all of these checks are guaranteed to eveluate one way or the other so they can be removed.
This commit is contained in:
parent
55a1a2a4c4
commit
97537d36b3
@ -395,12 +395,8 @@ else()
|
||||
# NOTE: it's not required to link against SFML.framework
|
||||
set_target_properties(SFML PROPERTIES INSTALL_NAME_DIR "@rpath")
|
||||
if(NOT CMAKE_SKIP_BUILD_RPATH)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.9)
|
||||
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
else()
|
||||
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# install rule
|
||||
install(TARGETS SFML
|
||||
|
@ -76,12 +76,7 @@ macro(sfml_add_library module)
|
||||
# Add required flags for GCC if coverage reporting is enabled
|
||||
if (SFML_ENABLE_COVERAGE AND (SFML_COMPILER_GCC OR SFML_COMPILER_CLANG))
|
||||
target_compile_options(${target} PUBLIC $<$<CONFIG:DEBUG>:-O0> $<$<CONFIG:DEBUG>:-g> $<$<CONFIG:DEBUG>:-fprofile-arcs> $<$<CONFIG:DEBUG>:-ftest-coverage>)
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
target_link_options(${target} PUBLIC $<$<CONFIG:DEBUG>:--coverage>)
|
||||
else()
|
||||
target_link_libraries(${target} PUBLIC $<$<CONFIG:DEBUG>:--coverage>)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_warnings(${target})
|
||||
@ -193,14 +188,10 @@ macro(sfml_add_library module)
|
||||
if(NOT CMAKE_SKIP_RPATH AND NOT CMAKE_SKIP_INSTALL_RPATH AND NOT CMAKE_INSTALL_RPATH AND NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH AND NOT CMAKE_INSTALL_NAME_DIR)
|
||||
set_target_properties(${target} PROPERTIES INSTALL_NAME_DIR "@rpath")
|
||||
if(NOT CMAKE_SKIP_BUILD_RPATH)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.9)
|
||||
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
else()
|
||||
set_target_properties(${target} PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (SFML_OS_IOS)
|
||||
sfml_set_common_ios_properties(${target})
|
||||
@ -333,15 +324,9 @@ function(sfml_add_test target SOURCES DEPENDS)
|
||||
# If coverage is enabled for MSVC and we are linking statically, use /WHOLEARCHIVE
|
||||
# to make sure the linker doesn't discard unused code sections before coverage can be measured
|
||||
if (SFML_ENABLE_COVERAGE AND SFML_COMPILER_MSVC AND NOT BUILD_SHARED_LIBS)
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
foreach (DEPENDENCY ${DEPENDS})
|
||||
target_link_options(${target} PRIVATE $<$<CONFIG:DEBUG>:/WHOLEARCHIVE:$<TARGET_LINKER_FILE:${DEPENDENCY}>>)
|
||||
endforeach()
|
||||
else()
|
||||
foreach (DEPENDENCY ${DEPENDS})
|
||||
target_link_libraries(${target} PRIVATE $<$<CONFIG:DEBUG>:/WHOLEARCHIVE:$<TARGET_LINKER_FILE:${DEPENDENCY}>>)
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add the test
|
||||
|
@ -283,7 +283,7 @@ target_include_directories(sfml-window SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/ext
|
||||
# CMake 3.11 and later prefer to choose GLVND, but we choose legacy OpenGL for backward compability
|
||||
# (unless the OpenGL_GL_PREFERENCE was explicitly set)
|
||||
# See CMP0072 for more details (cmake --help-policy CMP0072)
|
||||
if ((NOT ${CMAKE_VERSION} VERSION_LESS 3.11) AND (NOT OpenGL_GL_PREFERENCE))
|
||||
if (NOT OpenGL_GL_PREFERENCE)
|
||||
set(OpenGL_GL_PREFERENCE "LEGACY")
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user