Skip to content

Commit

Permalink
Add USE_LTO and enable it by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Fulgen301 committed Jul 16, 2023
1 parent 34dbc0d commit 687b3da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
option(DEBUGREC "Write additional debug control to records" OFF)
option(SOLIDMASK_DEBUG "Solid mask debugging" OFF)
option(USE_CONSOLE "Dedicated server mode (compile as pure console application)" OFF)
option(USE_LTO "Enable Link Time Optimization" ON)
option(USE_PCH "Precompile Headers" ON)
option(USE_STAT "Enable internal performance statistics for developers" OFF)

Expand Down Expand Up @@ -91,6 +92,13 @@ CMAKE_DEPENDENT_OPTION(USE_LIBNOTIFY "Use libnotify for desktop notifications" O
# USE_WINDOWS_RUNTIME
CMAKE_DEPENDENT_OPTION(USE_WINDOWS_RUNTIME "Use Windows Runtime features" ON "WIN32" OFF)

if (USE_LTO)
include(CheckIPOSupported)
check_ipo_supported()

set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
endif ()

if (WIN32)
# Don't define min/max macros in Windows.h so that they don't conflict with std::min/max
add_compile_definitions(NOMINMAX)
Expand Down

0 comments on commit 687b3da

Please sign in to comment.