at master 33 lines 1.5 kB view raw
1diff --git a/CMakeLists.txt b/CMakeLists.txt 2index c559bf5..42ed617 100644 3--- a/CMakeLists.txt 4+++ b/CMakeLists.txt 5@@ -106,7 +106,7 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") 6 elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel") 7 add_definitions(-DRELEASE) 8 if (NOT MSVC) 9- add_compile_options(-O3 $<$<CXX_COMPILER_ID:GNU>:-flto=auto>) 10+ add_compile_options(-O3) 11 endif() 12 else() 13 message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE}) 14@@ -116,19 +116,6 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") 15 add_compile_options(-fno-omit-frame-pointer) 16 endif() 17 18-# Linux GCC LTO plugin fix. 19-if (PLATFORM_LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_TYPE MATCHES "^Rel")) 20- # To force errors if LTO was not enabled. 21- add_compile_options(-fno-fat-lto-objects) 22- # To fix ar and ranlib "plugin needed to handle lto object". 23- string(REGEX MATCH "[0-9]+" GCC_MAJOR_VERSION ${CMAKE_CXX_COMPILER_VERSION}) 24- file(GLOB_RECURSE plugin /usr/lib/gcc/*/${GCC_MAJOR_VERSION}/liblto_plugin.so) 25- set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>") 26- set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>") 27- set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>") 28- set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>") 29-endif() 30- 31 message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) 32 33 if (PLATFORM_LINUX OR PLATFORM_ANDROID)