]> git.lizzy.rs Git - minetest.git/commitdiff
Set policies through CMake 3.9 to allow enabling IPO (#11560)
authorJosiahWI <41302989+JosiahWI@users.noreply.github.com>
Mon, 23 Aug 2021 20:13:47 +0000 (15:13 -0500)
committerGitHub <noreply@github.com>
Mon, 23 Aug 2021 20:13:47 +0000 (22:13 +0200)
CMakeLists.txt

index 7b266334186e33795ca9479196572c2eac0118b7..65c6bf6c3f89bafad655a7fa92b3f6138102ee12 100644 (file)
@@ -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")