summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-05-13 22:31:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-05-13 22:31:10 +0200
commitb819b1727899488bb46ad4b17468c9d4ae59ec2e (patch)
tree4111ea1f429c294344c7ef426d7fc4d17b61032c /cmake
parent74d9f5e31428ef362033a63c10b781d943c5e5a5 (diff)
cmake: automatically enable lto and loop vectorization for mingw-w64 targets
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/mingw-w64.cmake5
1 files 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} ")