summaryrefslogtreecommitdiffhomepage
path: root/cmake/mingw-w64.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-11-02 00:12:03 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-11-02 00:12:03 +0100
commit9f05b73e6cb3bb8224daef8dda39b42b4fa423c5 (patch)
tree473f9c553fd31d3ad696e80de63226ce0dfcd818 /cmake/mingw-w64.cmake
parenta9041b527deda97f146d20adedbd4b4717abc13e (diff)
cmake/mingw-w64: less krap
Diffstat (limited to 'cmake/mingw-w64.cmake')
-rw-r--r--cmake/mingw-w64.cmake30
1 files changed, 14 insertions, 16 deletions
diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake
index b715e99b..a7368418 100644
--- a/cmake/mingw-w64.cmake
+++ b/cmake/mingw-w64.cmake
@@ -6,23 +6,17 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 1)
-set(CMAKE_BUILD_TYPE_INIT RELEASE)
-# for nmake/jom build directories
-if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE)
-endif()
-
-unset(c)
-unset(e)
# specify the cross compiler
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
#set(p D:/cygwin64/opt/bin/)
set(p "C:/msys64/mingw32/bin/")
set(e .exe)
+ set(c "${p}")
+else()
+ set(p "/usr/bin/")
+ set(c "${p}i686-w64-mingw32-")
+ set(e "")
endif()
-#set(c ${p}i686-w64-mingw32-)
-set(c "${p}")
-#set(CMAKE_MAKE_PROGRAM ${p}/mingw32-make.exe CACHE FILEPATH "" FORCE)
SET(CMAKE_C_COMPILER ${c}gcc${e})
SET(CMAKE_CXX_COMPILER ${c}g++${e})
@@ -45,11 +39,13 @@ 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=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(cpu "-O3 -march=core2 -mtune=skylake -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")
-set(cc "-fdump-statistics-details -fdump-ipa-cgraph")
+set(cc "")
+#set(cc "-fdump-statistics-details -fdump-ipa-cgraph")
set(clang-warns "")
if(CMAKE_COMPILER_IS_CLANG)
@@ -90,7 +86,7 @@ set(_CFLAGS_DEBUG "-g -O0 -fstack-protector-strong")
set(_CXXFLAGS_RELEASE "${_CFLAGS_RELEASE} ${cc}")
set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}")
-set(_LDFLAGS "-Wl,--dynamicbase,--no-seh,--nxcompat,--as-needed,--pic-executable")
+set(_LDFLAGS "-Wl,--dynamicbase,--no-seh,--nxcompat,--as-needed,--pic-executable,--strip-all")
set(_LDFLAGS_RELEASE "-Wl,--gc-sections,--exclude-libs,ALL")
set(_LDFLAGS_DEBUG "")
@@ -117,6 +113,8 @@ foreach(j "" _DEBUG _RELEASE)
endforeach()
endforeach()
-if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+if(NOT __otr_toolchain_initialized)
+ set(__otr_toolchain_initialized 1 CACHE INTERNAL "" FORCE)
+ set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE)
endif()