diff --git a/CMakeLists.txt b/CMakeLists.txt index 731861ec..bdce18b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ option(FIX_BUGS "Fix various bugs in the game" OFF) option(DEBUG_SAVE "Re-enable the ability to drag-and-drop save files onto the window" OFF) set(RENDERER "SDLTexture" CACHE STRING "Which renderer the game should use: 'OpenGL3' for an OpenGL 3.2 renderer, 'OpenGLES2' for an OpenGL ES 2.0 renderer, 'SDLTexture' for SDL2's hardware-accelerated Texture API, 'SDLSurface' for SDL2's software-rendered Surface API, or 'Software' for a handwritten software renderer") +option(LTO "Enable link-time optimisation" OFF) option(WARNINGS "Enable common compiler warnings (for GCC-compatible compilers and MSVC only)" OFF) option(WARNINGS_ALL "Enable ALL compiler warnings (for Clang and MSVC only)" OFF) option(WARNINGS_FATAL "Stop compilation on any compiler warning (for GCC-compatible compilers and MSVC only)" OFF) @@ -444,7 +445,7 @@ add_custom_command(TARGET CSE2 POST_BUILD ) # Enable link-time optimisation if available -if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") +if(LTO) if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9)) include(CheckIPOSupported) check_ipo_supported(RESULT result) diff --git a/README.md b/README.md index 17886890..a47cae7e 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ You can also add the following flags: Name | Function --------|-------- +`-DLTO=ON` | Enable link-time optimisation `-DJAPANESE=ON` | Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation) `-DFIX_BUGS=ON` | Fix various bugs in the game `-DDEBUG_SAVE=ON` | Re-enable the ability to drag-and-drop save files onto the window