summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-06-20 18:44:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-06-20 18:44:10 +0200
commit9b2df9f1c597ed531f5b675ae32eec6fe515e4a6 (patch)
treef49bfc524507ed92067b46ca83acc64aae6819ff /cmake
parentb5a2d056b8840b03e53f8cb7c6da9fec4aded8c9 (diff)
cmake: update cross toolchain
Diffstat (limited to 'cmake')
-rw-r--r--cmake/mingw-w64.cmake54
1 files changed, 28 insertions, 26 deletions
diff --git a/cmake/mingw-w64.cmake b/cmake/mingw-w64.cmake
index b543bbdd..e8c0f062 100644
--- a/cmake/mingw-w64.cmake
+++ b/cmake/mingw-w64.cmake
@@ -13,31 +13,33 @@ endif()
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 5)
+set(CMAKE_SYSROOT "/usr/i686-w64-mingw32")
+
+set(c "")
## specify the cross compiler
-#if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
-# #set(p D:/cygwin64/opt/bin/)
-# #set(p "/mingw32/bin/")
-# set(p "")
-# set(e .exe)
-# set(c "${p}")
-#else()
-# set(p "")
-# set(c "${p}i686-w64-mingw32-")
-# set(e "")
-#endif()
-#
-#SET(CMAKE_C_COMPILER ${c}gcc${e})
-#SET(CMAKE_CXX_COMPILER ${c}g++${e})
-#set(CMAKE_RC_COMPILER ${c}windres${e})
-#set(CMAKE_LINKER ${c}ld${e})
-#set(CMAKE_AR ${c}gcc-ar${e} CACHE STRING "" FORCE)
-#set(CMAKE_NM ${c}gcc-nm${e} CACHE STRING "" FORCE)
-#set(CMAKE_RANLIB ${c}gcc-ranlib${e} CACHE STRING "" FORCE)
-#set(CMAKE_OBJCOPY ${c}objcopy${e} CACHE STRING "" FORCE)
-#set(CMAKE_OBJDUMP ${c}objdump${e} CACHE STRING "" FORCE)
-#set(CMAKE_STRIP ${c}strip${e} CACHE STRING "" FORCE)
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+ #set(p D:/cygwin64/opt/bin/)
+ #set(p "/mingw32/bin/")
+ set(p "")
+ set(e .exe)
+ set(c "${p}")
+else()
+ set(p "")
+ set(c "i686-w64-mingw32-")
+ set(e "")
+endif()
+SET(CMAKE_C_COMPILER ${c}gcc${e})
+SET(CMAKE_CXX_COMPILER ${c}g++${e})
+set(CMAKE_RC_COMPILER ${c}windres${e})
+set(CMAKE_LINKER ${c}ld${e})
+set(CMAKE_AR ${c}gcc-ar${e})
+set(CMAKE_NM ${c}gcc-nm${e})
+set(CMAKE_RANLIB ${c}gcc-ranlib${e})
+set(CMAKE_OBJCOPY ${c}objcopy${e})
+set(CMAKE_OBJDUMP ${c}objdump${e})
+set(CMAKE_STRIP ${c}strip${e})
# search for programs in the host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
@@ -91,9 +93,9 @@ set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}")
add_definitions(-DSTRSAFE_NO_DEPRECATE)
-#set(_LDFLAGS "-Wl,--dynamicbase,--nxcompat,--as-needed")
-#set(_LDFLAGS_RELEASE "-Wl,--gc-sections,--exclude-libs,ALL")
-#set(_LDFLAGS_DEBUG "")
+#set(_LDFLAGS "-Wl,--dynamicbase,--nxcompat,--as-needed -Wl,--gc-sections,--exclude-libs,ALL")
+set(_LDFLAGS_RELEASE "")
+set(_LDFLAGS_DEBUG "")
set(enable-val FALSE)
if(CMAKE_PROJECT_NAME STREQUAL "opentrack")
@@ -108,7 +110,7 @@ set(WARNINGS_MISSING_OVERRIDE FALSE CACHE BOOL "Emit very noisy warnings at comp
foreach(j C CXX)
foreach(i "" _DEBUG _RELEASE)
- set(CMAKE_${j}_FLAGS${i} "${_${j}FLAGS${i}} ${CMAKE_${j}_FLAGS${j}}")
+ set(CMAKE_${j}_FLAGS${i} "${CMAKE_${j}_FLAGS${j}}")
endforeach()
endforeach()