diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-05 15:39:42 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-05 15:39:42 +0200 |
commit | 6fd73e314dbf6d52fb0edb2118265630619bc817 (patch) | |
tree | edc69c02347e0c5077b98b1167ea8a47f1d7f559 /cmake/mingw-w64.cmake | |
parent | e0eb955b18a037ebe31cef7b944b779ae7d339a4 (diff) |
cmake: fix mingw-w64
Diffstat (limited to 'cmake/mingw-w64.cmake')
-rw-r--r-- | cmake/mingw-w64.cmake | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake index d32f4a1c..1879ab3a 100644 --- a/cmake/mingw-w64.cmake +++ b/cmake/mingw-w64.cmake @@ -3,6 +3,19 @@ # mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$(pwd)/../cmake/mingw-w64.cmake # -sh 20140922 +if((NOT CMAKE_BUILD_TYPE STREQUAL "DEBUG") AND (NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE")) + set(CMAKE_BUILD_TYPE "DEBUG" CACHE STRING "" FORCE) +endif() + +string(TOUPPER "${CMAKE_BUILD_TYPE}" __build_type) +if(NOT __build_type STREQUAL CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "${__build_type}" CACHE STRING "" FORCE) +endif() + +if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE STRING "" FORCE) +endif() + SET(CMAKE_SYSTEM_NAME Windows) SET(CMAKE_SYSTEM_VERSION 5) @@ -39,7 +52,7 @@ 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=i686 -msse3 -mtune=skylake -frename-registers") +set(cpu "-O3 -march=native -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(lto "") set(sections "-ffunction-sections -fdata-sections -s") @@ -115,7 +128,4 @@ foreach(j "" _DEBUG _RELEASE) endforeach() endforeach() -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE) - set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE) -endif() + |