diff --git a/CMakeLists.txt b/CMakeLists.txt index 49363f3..3445130 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,6 +128,10 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$") set(PLATFORM_LIBRARIES rt) endif() +if (NOT MSVC) + add_compile_options("-flto") +endif() + # Include source code # =================== add_subdirectory(externals) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8355b78..00f31f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -104,7 +104,7 @@ else() if (MINGW_STATIC_BUILD) add_definitions(-DQT_STATICPLUGIN) - add_compile_options("-static -flto") + add_compile_options("-static") endif() endif()