summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-10-05 15:39:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-10-05 15:39:42 +0200
commit6fd73e314dbf6d52fb0edb2118265630619bc817 (patch)
treeedc69c02347e0c5077b98b1167ea8a47f1d7f559 /cmake
parente0eb955b18a037ebe31cef7b944b779ae7d339a4 (diff)
cmake: fix mingw-w64
Diffstat (limited to 'cmake')
-rw-r--r--cmake/mingw-w64.cmake20
-rw-r--r--cmake/opentrack-platform.cmake9
2 files changed, 22 insertions, 7 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()
+
diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake
index c9bc2fca..1e34a5ef 100644
--- a/cmake/opentrack-platform.cmake
+++ b/cmake/opentrack-platform.cmake
@@ -22,13 +22,18 @@
# OTHER DEALINGS IN THE SOFTWARE.
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE)
+ if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE)
+ endif()
endif()
+string(TOUPPER "${CMAKE_BUILD_TYPE}" __build_type)
+set(CMAKE_BUILD_TYPE "${__build_type}" CACHE STRING "" FORCE)
+
if(APPLE)
if(NOT CMAKE_OSX_ARCHITECTURES)
- set(CMAKE_OSX_ARCHITECTURES "x86_64")
+ set(CMAKE_OSX_ARCHITECTURES "x86_64")
endif()
endif()