summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-09-05 14:45:25 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-09-05 14:45:25 (GMT)
commit1ca73845326ab5ab4f63f684babe3549e1c90e63 (patch)
tree2e4ccc65e748aa4ff4d516d6e3babdae9bfaae6b /config
parentf651cb4747bafc6025b2a51cf96c065f353ab058 (diff)
downloadhdf5-1ca73845326ab5ab4f63f684babe3549e1c90e63.zip
hdf5-1ca73845326ab5ab4f63f684babe3549e1c90e63.tar.gz
hdf5-1ca73845326ab5ab4f63f684babe3549e1c90e63.tar.bz2
Correct name and add mingw to 32bit toolchain
Diffstat (limited to 'config')
-rw-r--r--config/toolchain/build32.cmake36
1 files changed, 36 insertions, 0 deletions
diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake
index d078956..deb5899 100644
--- a/config/toolchain/build32.cmake
+++ b/config/toolchain/build32.cmake
@@ -3,6 +3,42 @@ if (WIN32)
set (CMAKE_GENERATOR_PLATFORM "x86")
elseif(APPLE)
set (CMAKE_OSX_ARCHITECTURES "i386")
+elseif(MINGW)
+ set (CMAKE_SYSTEM_NAME Windows)
+ set (CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+ set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+ set (CMAKE_RC_COMPILER i686-w64-mingw32-windres)
+ set (CMAKE_Fortran_COMPILER i686-w64-mingw32-gfortran)
+
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
+
+ set (LIB32 /usr/lib) # Fedora
+
+ if (EXISTS "/usr/lib32")
+ set (LIB32 /usr/lib32) # Arch, Solus
+ endif ()
+
+ set (CMAKE_SYSTEM_LIBRARY_PATH ${LIB32} CACHE STRING "system library search path" FORCE)
+ set (CMAKE_LIBRARY_PATH ${LIB32} CACHE STRING "library search path" FORCE)
+
+ # this is probably unlikely to be needed, but just in case
+ set (CMAKE_EXE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "executable linker flags" FORCE)
+ set (CMAKE_SHARED_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "shared library linker flags" FORCE)
+ set (CMAKE_MODULE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "module linker flags" FORCE)
+
+ # on Fedora and Arch and similar, point pkgconfig at 32 bit .pc files. We have
+ # to include the regular system .pc files as well (at the end), because some
+ # are not always present in the 32 bit directory
+ if (EXISTS "${LIB32}/pkgconfig")
+ set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig)
+ endif ()
+
+ set (CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+ set (CMAKE_CROSSCOMPILING_EMULATOR wine32)
else ()
set (CMAKE_SYSTEM_NAME Linux)