summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/mingw-w64.cmake62
1 files changed, 31 insertions, 31 deletions
diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake
index 38567d54..d2409e59 100644
--- a/cmake/mingw-w64.cmake
+++ b/cmake/mingw-w64.cmake
@@ -45,31 +45,53 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# oldest CPU supported here is Northwood-based Pentium 4. -sh 20150811
set(fpu "-ffast-math -mfpmath=both -mstackrealign -falign-functions=16 -falign-loops=16")
-set(cpu "-O3 -march=pentium4 -mtune=corei7-avx -msse -msse2 -mno-sse3 -mno-avx -frename-registers")
-set(lto "-fno-lto -fuse-linker-plugin -flto-compression-level=9 -flto-partition=balanced -fno-ipa-pta -fno-lto-odr-type-merging")
-set(bloat "")
+set(cpu "-O3 -march=pentium4 -mtune=skylake -msse -msse2 -mno-sse3 -mno-avx -frename-registers")
+set(lto "-fno-lto -fno-use-linker-plugin -flto-compression-level=9 -flto-partition=balanced -fno-ipa-pta -fno-lto-odr-type-merging")
set(sections "-ffunction-sections -fdata-sections")
-set(cc "-fdump-statistics-details -fdump-ipa-cgraph -floop-nest-optimize")
+set(cc "-fdump-statistics-details -fdump-ipa-cgraph")
+
+set(clang-warns "")
+if(CMAKE_COMPILER_IS_CLANG)
+ set(clang-warns "-Wweak-vtables")
+endif()
+
+set(noisy-warns "")
+set(suggest-final "")
+set(numerics "")
+set(missing-override "")
+if(WARNINGS_ENABLE)
+ if(WARNINGS_FINAL_SUGGESTIONS)
+ set(suggest-final "-Wsuggest-final-types -Wsuggest-final-methods")
+ endif()
+ if(WARNINGS_NUMERIC)
+ set(numerics "-Wdouble-promotion -Wsign-compare")
+ endif()
+ if(WARNINGS_MISSING_OVERRIDE)
+ set(missing-override "-Wsuggest-override")
+ endif()
+ set(noisy-warns "${suggest-final} ${numerics}")
+endif()
set(_CXX_WARNS "")
set(_C_WARNS "")
+
if(WARNINGS_ENABLE)
set(usual-warns "-Wdelete-non-virtual-dtor -Wno-suggest-override -Wno-odr -Wno-attributes -Wcast-align")
set(_C_WARNS "-Wall -Wextra -Wpedantic -Wcast-align")
set(_CXX_WARNS "${_C_WARNS} ${usual-warns} ${clang-warns} ${noisy-warns} ${missing-override}")
endif()
-set(ccflags-common "-fvisibility=hidden -pipe")
-set(_CXXFLAGS "${bloat} ${ccflags-common} ${_CXX_WARNS}")
+set(ccflags-common "-fvisibility=hidden -pipe -g3")
+set(_CXXFLAGS "${ccflags-common} ${_CXX_WARNS}")
set(_CFLAGS "${ccflags-common} -std=c11 ${_C_WARNS}")
-set(_CFLAGS_RELEASE "-s ${cpu} ${fpu} ${lto} ${sections} ${cc}")
+set(_CFLAGS_RELEASE "${cpu} ${fpu} ${lto} ${sections} ${cc}")
set(_CFLAGS_DEBUG "-g -O0 -fstack-protector-strong")
-set(_CXXFLAGS_RELEASE "${_CFLAGS_RELEASE} -std=c++14 ${cc}")
+set(_CXXFLAGS_RELEASE "${_CFLAGS_RELEASE} ${cc}")
set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}")
set(_LDFLAGS "-Wl,--dynamicbase,--no-seh,--nxcompat,--as-needed,--pic-executable")
-set(_LDFLAGS_RELEASE "-Wl,--gc-sections,--exclude-libs,ALL -ffunction-sections -fdata-sections")
+set(_LDFLAGS_RELEASE "-Wl,--gc-sections,--exclude-libs,ALL")
set(_LDFLAGS_DEBUG "")
set(enable-val FALSE)
@@ -83,28 +105,6 @@ set(WARNINGS_FINAL_SUGGESTIONS FALSE CACHE BOOL "Emit very noisy warnings at com
set(WARNINGS_NUMERIC ${enable-val} CACHE BOOL "Emit very noisy warnings at compile-time")
set(WARNINGS_MISSING_OVERRIDE FALSE CACHE BOOL "Emit very noisy warnings at compile-time")
-set(noisy-warns "")
-set(suggest-final "")
-set(numerics "")
-set(missing-override "")
-if(WARNINGS_ENABLE)
- if(WARNINGS_FINAL_SUGGESTIONS)
- set(suggest-final "-Wsuggest-final-types -Wsuggest-final-methods")
- endif()
- if(WARNINGS_NUMERIC)
- set(numerics "-Wdouble-promotion -Wsign-compare")
- endif()
- if(WARNINGS_MISSING_OVERRIDE)
- set(missing-override "-Wsuggest-override")
- endif()
- set(noisy-warns "${suggest-final} ${numerics}")
-endif()
-
-set(clang-warns "")
-if(CMAKE_COMPILER_IS_CLANG)
- set(clang-warns "-Wweak-vtables")
-endif()
-
foreach(j C CXX)
foreach(i "" _DEBUG _RELEASE)
set(CMAKE_${j}_FLAGS${i} "${_${j}FLAGS${i}} ${CMAKE_${j}_FLAGS${j}}")