summaryrefslogtreecommitdiffstats
path: root/config/toolchain
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
commitc8f533cfc33ac743227cbed8eba361c715a2976f (patch)
treebcae5320f80bac774647cacbbd8493604f9384d2 /config/toolchain
parentadcf8a315e82c0848d126e7e46b662930c081896 (diff)
downloadhdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.zip
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.gz
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.bz2
Merge all of my changes from merge-back-to-feature-vfd_swmr-attempt-1,
including the merge of `hdffv/hdf5/develop`, back to the branch that Vailin and I share. Now I need to put this branch on a fork with a less confusing name than vchoi_fork!
Diffstat (limited to 'config/toolchain')
-rw-r--r--config/toolchain/GCC.cmake11
-rw-r--r--config/toolchain/PGI.cmake11
-rw-r--r--config/toolchain/build32.cmake75
-rw-r--r--config/toolchain/clang.cmake29
-rw-r--r--config/toolchain/crayle.cmake10
-rw-r--r--config/toolchain/intel.cmake11
-rw-r--r--config/toolchain/mingw64.cmake14
7 files changed, 161 insertions, 0 deletions
diff --git a/config/toolchain/GCC.cmake b/config/toolchain/GCC.cmake
new file mode 100644
index 0000000..c41d0ca
--- /dev/null
+++ b/config/toolchain/GCC.cmake
@@ -0,0 +1,11 @@
+# Uncomment the following line and the correct system name to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "GCC")
+
+set(CMAKE_C_COMPILER cc)
+set(CMAKE_CXX_COMPILER c++)
+set(CMAKE_Fortran_COMPILER gfortran)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/config/toolchain/PGI.cmake b/config/toolchain/PGI.cmake
new file mode 100644
index 0000000..ec58cbb
--- /dev/null
+++ b/config/toolchain/PGI.cmake
@@ -0,0 +1,11 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "PGI")
+
+set(CMAKE_C_COMPILER pgcc)
+set(CMAKE_CXX_COMPILER pgc++)
+set(CMAKE_Fortran_COMPILER pgf90)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake
new file mode 100644
index 0000000..deb5899
--- /dev/null
+++ b/config/toolchain/build32.cmake
@@ -0,0 +1,75 @@
+if (WIN32)
+ set (CMAKE_SYSTEM_NAME Windows)
+ 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)
+
+ 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 ()
+# where is the target environment
+ set (CMAKE_FIND_ROOT_PATH ${LIB32})
+# search for programs in the build host directories
+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+# for libraries and headers in the target directories
+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+endif () \ No newline at end of file
diff --git a/config/toolchain/clang.cmake b/config/toolchain/clang.cmake
new file mode 100644
index 0000000..7dac587
--- /dev/null
+++ b/config/toolchain/clang.cmake
@@ -0,0 +1,29 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "clang")
+
+set(CMAKE_C_COMPILER clang)
+set(CMAKE_CXX_COMPILER clang++)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+find_program(
+ CLANG_TIDY_EXE
+ NAMES "clang-tidy"
+ DOC "Path to clang-tidy executable"
+)
+
+set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}" -checks=*,clang-analyzer-*)
+set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" -checks=*,clang-analyzer-*)
+
+#find_program(
+# CLANG_FORMAT_EXE
+# NAMES "clang-format"
+# DOC "Path to clang-format executable"
+#)
+#
+#set(CMAKE_C_CLANG_FORMAT "${CLANG_FORMAT_EXE}")
+#set(CMAKE_CXX_CLANG_FORMAT "${CLANG_FORMAT_EXE}")
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/config/toolchain/crayle.cmake b/config/toolchain/crayle.cmake
new file mode 100644
index 0000000..bf7cf69
--- /dev/null
+++ b/config/toolchain/crayle.cmake
@@ -0,0 +1,10 @@
+# The following line will use cross-compiling
+set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "CrayLinuxEnvironment")
+
+set(CMAKE_C_COMPILER cc)
+set(CMAKE_Fortran_COMPILER ftn)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/config/toolchain/intel.cmake b/config/toolchain/intel.cmake
new file mode 100644
index 0000000..97f6a64
--- /dev/null
+++ b/config/toolchain/intel.cmake
@@ -0,0 +1,11 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "intel")
+
+set(CMAKE_C_COMPILER icc)
+set(CMAKE_CXX_COMPILER icpc)
+set(CMAKE_Fortran_COMPILER ifort)
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")
diff --git a/config/toolchain/mingw64.cmake b/config/toolchain/mingw64.cmake
new file mode 100644
index 0000000..fde5e38
--- /dev/null
+++ b/config/toolchain/mingw64.cmake
@@ -0,0 +1,14 @@
+set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
+set (CMAKE_SYSTEM_NAME Windows)
+set (CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
+set (CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set (CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
+set (CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
+set (CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /usr/local/${TOOLCHAIN_PREFIX})
+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 wine64)
+
+include_directories(/usr/local/${TOOLCHAIN_PREFIX}/include)
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On CACHE BOOL "Export windows symbols")