From b819b1727899488bb46ad4b17468c9d4ae59ec2e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 13 May 2016 22:31:10 +0200 Subject: cmake: automatically enable lto and loop vectorization for mingw-w64 targets --- cmake/mingw-w64.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake index 7d3db429..74654b19 100755 --- a/cmake/mingw-w64.cmake +++ b/cmake/mingw-w64.cmake @@ -30,12 +30,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # oldest CPU supported here is Northwood-based Pentium 4. -sh 20150811 -set(fpu "-ffast-math -fno-finite-math-only -mfpmath=both") +set(fpu "-ffast-math -fno-finite-math-only -mfpmath=both -mstackrealign -ftree-vectorize") set(cpu "-O3 -march=pentium4 -mtune=corei7-avx -msse -msse2 -mno-sse3 -mno-avx -frename-registers -fno-PIC") +set(lto "-flto -fuse-linker-plugin") set(_CFLAGS " -fvisibility=hidden ") set(_CXXFLAGS " -fvisibility-inlines-hidden ${_CFLAGS} ") -set(_CFLAGS_RELEASE " -s ${cpu} ${fpu} ") +set(_CFLAGS_RELEASE " -s ${cpu} ${fpu} ${lto} ") set(_CFLAGS_DEBUG "-g -ggdb ${cpu} ${fpu} ") set(_CXXFLAGS_RELEASE " ${_CFLAGS_RELEASE} ") set(_CXXFLAGS_DEBUG " ${_CFLAGS_DEBUG} ") -- cgit v1.2.3