shithub: cstory

Download patch

ref: f249f8c60429bf95af27807d9803f5faf002bce9
parent: 2b7bda3b4a2cdb4b20a1c53f3b7346f9a64aaf41
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Apr 9 21:42:17 EDT 2019

Added link-time optimisation to cmake file

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -264,6 +264,15 @@
 
 add_executable(CSE2 ${SOURCES} ${RESOURCE_HEADERS})
 
+if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+	# Enable link-time optimisation if available
+	include(CheckIPOSupported)
+	check_ipo_supported(RESULT result)
+	if (result)
+		set_target_properties(CSE2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
+	endif()
+endif()
+
 if (MSVC)
 	if (STATIC)
 		message(WARNING "Static builds are not available for MSVC")