diff --git a/CMakeLists.txt b/CMakeLists.txt index c559bf5..42ed617 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,7 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel") add_definitions(-DRELEASE) if (NOT MSVC) - add_compile_options(-O3 $<$:-flto=auto>) + add_compile_options(-O3) endif() else() message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE}) @@ -116,19 +116,6 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") add_compile_options(-fno-omit-frame-pointer) endif() -# Linux GCC LTO plugin fix. -if (PLATFORM_LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_TYPE MATCHES "^Rel")) - # To force errors if LTO was not enabled. - add_compile_options(-fno-fat-lto-objects) - # To fix ar and ranlib "plugin needed to handle lto object". - string(REGEX MATCH "[0-9]+" GCC_MAJOR_VERSION ${CMAKE_CXX_COMPILER_VERSION}) - file(GLOB_RECURSE plugin /usr/lib/gcc/*/${GCC_MAJOR_VERSION}/liblto_plugin.so) - set(CMAKE_C_ARCHIVE_CREATE " --plugin ${plugin} qcs ") - set(CMAKE_C_ARCHIVE_FINISH " --plugin ${plugin} ") - set(CMAKE_CXX_ARCHIVE_CREATE " --plugin ${plugin} qcs ") - set(CMAKE_CXX_ARCHIVE_FINISH " --plugin ${plugin} ") -endif() - message(STATUS "Build type: " ${CMAKE_BUILD_TYPE}) if (PLATFORM_LINUX OR PLATFORM_ANDROID)