Fix backwards-incompatible CMake nonsense

This commit is contained in:
Clownacy 2019-04-16 18:57:33 +01:00
parent 9effc5e0fe
commit 7e038bc24a

View file

@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.7.2) cmake_minimum_required(VERSION 3.7.2)
if ((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9))
cmake_policy(SET CMP0069 NEW)
endif()
option(STATIC "Produce a statically-linked executable (good for Windows builds, so you don't need to bundle DLL files)" OFF) option(STATIC "Produce a statically-linked executable (good for Windows builds, so you don't need to bundle DLL files)" OFF)
option(JAPANESE "Enable the Japanese-language build" OFF) option(JAPANESE "Enable the Japanese-language build" OFF)
option(FIX_BUGS "Fix certain bugs (see src/Bug Fixes.txt)" OFF) option(FIX_BUGS "Fix certain bugs (see src/Bug Fixes.txt)" OFF)
@ -263,9 +267,9 @@ foreach(FILENAME IN LISTS RESOURCES)
endforeach() endforeach()
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
if ((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9))
# Enable link-time optimisation if available # Enable link-time optimisation if available
include(CheckIPOSupported OPTIONAL RESULT_VARIABLE result) include(CheckIPOSupported)
if (result)
check_ipo_supported(RESULT result) check_ipo_supported(RESULT result)
if (result) if (result)
set_target_properties(CSE2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) set_target_properties(CSE2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)