diff options
author | JosiahWI <41302989+JosiahWI@users.noreply.github.com> | 2021-08-23 15:13:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 22:13:47 +0200 |
commit | ef84c3b8b97b073cd989e9d19171f6d46bfcbd37 (patch) | |
tree | 17793e9db94d53a2f914ed693221361c6f27d428 /CMakeLists.txt | |
parent | 63e8224636cec3ede1dbb8b78954a8e3a82407a5 (diff) | |
download | minetest-ef84c3b8b97b073cd989e9d19171f6d46bfcbd37.tar.gz minetest-ef84c3b8b97b073cd989e9d19171f6d46bfcbd37.tar.bz2 minetest-ef84c3b8b97b073cd989e9d19171f6d46bfcbd37.zip |
Set policies through CMake 3.9 to allow enabling IPO (#11560)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2663341..65c6bf6c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,12 @@ cmake_minimum_required(VERSION 3.5) +# Set policies up to 3.9 since we want to enable the IPO option +if(${CMAKE_VERSION} VERSION_LESS 3.9) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +else() + cmake_policy(VERSION 3.9) +endif() + # This can be read from ${PROJECT_NAME} after project() is called project(minetest) set(PROJECT_NAME_CAPITALIZED "Minetest") |