summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorx12xx12x <44411062+12xx12@users.noreply.github.com>2023-05-19 16:52:35 +0200
committerGitHub <noreply@github.com>2023-05-19 16:52:35 +0200
commita4668c000cfe1a17e457f463dd8c0ce69dc98877 (patch)
treed2e2213d1d7a39c4d3bcbe163436ea888fdc2272
parentUrlClient: Fixed invalid Content-Length header. (diff)
downloadcuberite-a4668c000cfe1a17e457f463dd8c0ce69dc98877.tar
cuberite-a4668c000cfe1a17e457f463dd8c0ce69dc98877.tar.gz
cuberite-a4668c000cfe1a17e457f463dd8c0ce69dc98877.tar.bz2
cuberite-a4668c000cfe1a17e457f463dd8c0ce69dc98877.tar.lz
cuberite-a4668c000cfe1a17e457f463dd8c0ce69dc98877.tar.xz
cuberite-a4668c000cfe1a17e457f463dd8c0ce69dc98877.tar.zst
cuberite-a4668c000cfe1a17e457f463dd8c0ce69dc98877.zip
-rw-r--r--CMakeLists.txt18
1 files changed, 11 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3ac53a4c..e1c271b52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,13 +33,6 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
-# The need for speed (in Release):
-if(WHOLE_PROGRAM_OPTIMISATION)
- include(CheckIPOSupported)
- check_ipo_supported(RESULT IPO_SUPPORTED)
- set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ${IPO_SUPPORTED})
-endif()
-
# Static CRT:
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
@@ -99,6 +92,17 @@ if(SELF_TEST)
add_subdirectory(tests)
endif()
+# The need for speed (in Release):
+if(WHOLE_PROGRAM_OPTIMISATION)
+ include(CheckIPOSupported)
+ check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_CHECK_OUTPUT)
+ if(IPO_SUPPORTED)
+ set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+ else()
+ message(WARNING "IPO is not supported: ${IPO_CHECK_OUTPUT}")
+ endif()
+endif()
+
emit_fixups()
group_sources()
enable_bindings_generation()