diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ec23c0b..da558f9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,10 +56,18 @@ if (MSVC) SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:SSE2") endif () SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG") + SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG") + SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG") + SET(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG") else () message("Enabling non-MSVC optimizations") - SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -mfpmath=sse -mmmx -msse -msse2") - SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -mfpmath=sse -mmmx -msse -msse2") + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -mfpmath=sse -mmmx -msse -msse2") + SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto -mfpmath=sse -mmmx -msse -msse2") + SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}") + SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}") + SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}") + SET(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}") + message("${CMAKE_C_FLAGS_RELEASE} ---- ${CMAKE_CXX_FLAGS_RELEASE} ---- ${CMAKE_EXE_LINKER_FLAGS_RELEASE} ---- ${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ---- ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ---- ${CMAKE_STATIC_LINKER_FLAGS_RELEASE}") endif () project(Poltergeist)