about summary refs log tree commit diff
path: root/toolchains
diff options
context:
space:
mode:
Diffstat (limited to 'toolchains')
-rw-r--r--toolchains/.gitignore2
-rw-r--r--toolchains/clang-cxx17.cmake13
-rw-r--r--toolchains/gcc-cxx11.cmake13
-rw-r--r--toolchains/gcc-cxx17.cmake13
-rw-r--r--toolchains/gcc-cxx98.cmake13
-rw-r--r--toolchains/gcc-gnuxx11.cmake13
-rw-r--r--toolchains/linux-mingw-w64-cxx11.cmake33
-rw-r--r--toolchains/linux-mingw-w64-cxx17.cmake33
-rw-r--r--toolchains/linux-mingw-w64-gnuxx11.cmake33
-rw-r--r--toolchains/mingw-cxx11.cmake13
-rw-r--r--toolchains/mingw-cxx17.cmake13
-rw-r--r--toolchains/mingw-gnuxx11.cmake13
-rw-r--r--toolchains/vs-14-2015-sdk-8-1.cmake2
-rw-r--r--toolchains/vs-14-2015-win64.cmake1
-rw-r--r--toolchains/vs-15-2017-win64-cxx17.cmake2
-rw-r--r--toolchains/vs-15-2017-win64.cmake1
16 files changed, 211 insertions, 0 deletions
diff --git a/toolchains/.gitignore b/toolchains/.gitignore
new file mode 100644
index 000000000000..13489ce3b5db
--- /dev/null
+++ b/toolchains/.gitignore
@@ -0,0 +1,2 @@
+# allow toolchain files to be tracked by git
+!*.cmake
diff --git a/toolchains/clang-cxx17.cmake b/toolchains/clang-cxx17.cmake
new file mode 100644
index 000000000000..09d077a38d7c
--- /dev/null
+++ b/toolchains/clang-cxx17.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/gcc.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER clang)
+set(CMAKE_CXX_COMPILER clang++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/gcc-cxx11.cmake b/toolchains/gcc-cxx11.cmake
new file mode 100644
index 000000000000..da1ab5778a27
--- /dev/null
+++ b/toolchains/gcc-cxx11.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/gcc.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/gcc-cxx17.cmake b/toolchains/gcc-cxx17.cmake
new file mode 100644
index 000000000000..1b834f12015b
--- /dev/null
+++ b/toolchains/gcc-cxx17.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/gcc.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/gcc-cxx98.cmake b/toolchains/gcc-cxx98.cmake
new file mode 100644
index 000000000000..5697ab252aae
--- /dev/null
+++ b/toolchains/gcc-cxx98.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/gcc.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 98)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/gcc-gnuxx11.cmake b/toolchains/gcc-gnuxx11.cmake
new file mode 100644
index 000000000000..91f0e4a3ce76
--- /dev/null
+++ b/toolchains/gcc-gnuxx11.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/gcc.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS ON)
diff --git a/toolchains/linux-mingw-w64-cxx11.cmake b/toolchains/linux-mingw-w64-cxx11.cmake
new file mode 100644
index 000000000000..9c6e126a68d2
--- /dev/null
+++ b/toolchains/linux-mingw-w64-cxx11.cmake
@@ -0,0 +1,33 @@
+# Sample toolchain file for building for Windows from an Ubuntu Linux system.
+#
+# Typical usage:
+#    *) install cross compiler: `sudo apt-get install mingw-w64`
+#    *) cmake -H. -B_build_mingw -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/linux-mingw-w64.cmake"
+
+set(CMAKE_SYSTEM_NAME Windows)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
+set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
+
+# set compiler
+set(CMAKE_C_COMPILER   ${TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set(CMAKE_RC_COMPILER  ${TOOLCHAIN_PREFIX}-windres)
+
+# target environment on the build host system
+#   set 1st to dir with the cross compiler's C/C++ headers/libs
+set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
+
+# modify default behavior of FIND_XXX() commands to
+# search for headers/libs in the target environment and
+# search for programs in the build host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# use emulator for `try_run` calls
+set(CMAKE_CROSSCOMPILING_EMULATOR wine64)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/linux-mingw-w64-cxx17.cmake b/toolchains/linux-mingw-w64-cxx17.cmake
new file mode 100644
index 000000000000..1c363f10eb10
--- /dev/null
+++ b/toolchains/linux-mingw-w64-cxx17.cmake
@@ -0,0 +1,33 @@
+# Sample toolchain file for building for Windows from an Ubuntu Linux system.
+#
+# Typical usage:
+#    *) install cross compiler: `sudo apt-get install mingw-w64`
+#    *) cmake -H. -B_build_mingw -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/linux-mingw-w64.cmake"
+
+set(CMAKE_SYSTEM_NAME Windows)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
+set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
+
+# set compiler
+set(CMAKE_C_COMPILER   ${TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set(CMAKE_RC_COMPILER  ${TOOLCHAIN_PREFIX}-windres)
+
+# target environment on the build host system
+#   set 1st to dir with the cross compiler's C/C++ headers/libs
+set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
+
+# modify default behavior of FIND_XXX() commands to
+# search for headers/libs in the target environment and
+# search for programs in the build host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# use emulator for `try_run` calls
+set(CMAKE_CROSSCOMPILING_EMULATOR wine64)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/linux-mingw-w64-gnuxx11.cmake b/toolchains/linux-mingw-w64-gnuxx11.cmake
new file mode 100644
index 000000000000..99029649dfa3
--- /dev/null
+++ b/toolchains/linux-mingw-w64-gnuxx11.cmake
@@ -0,0 +1,33 @@
+# Sample toolchain file for building for Windows from an Ubuntu Linux system.
+#
+# Typical usage:
+#    *) install cross compiler: `sudo apt-get install mingw-w64`
+#    *) cmake -H. -B_build_mingw -DCMAKE_TOOLCHAIN_FILE="${PWD}/toolchains/linux-mingw-w64.cmake"
+
+set(CMAKE_SYSTEM_NAME Windows)
+set(CMAKE_SYSTEM_PROCESSOR x86_64)
+set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
+
+# set compiler
+set(CMAKE_C_COMPILER   ${TOOLCHAIN_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
+set(CMAKE_RC_COMPILER  ${TOOLCHAIN_PREFIX}-windres)
+
+# target environment on the build host system
+#   set 1st to dir with the cross compiler's C/C++ headers/libs
+set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
+
+# modify default behavior of FIND_XXX() commands to
+# search for headers/libs in the target environment and
+# search for programs in the build host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+# use emulator for `try_run` calls
+set(CMAKE_CROSSCOMPILING_EMULATOR wine64)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS ON)
diff --git a/toolchains/mingw-cxx11.cmake b/toolchains/mingw-cxx11.cmake
new file mode 100644
index 000000000000..873f623f6011
--- /dev/null
+++ b/toolchains/mingw-cxx11.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="%cd%\toolchains\mingw.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/mingw-cxx17.cmake b/toolchains/mingw-cxx17.cmake
new file mode 100644
index 000000000000..c0c89cc459f4
--- /dev/null
+++ b/toolchains/mingw-cxx17.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="%cd%\toolchains\mingw.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/toolchains/mingw-gnuxx11.cmake b/toolchains/mingw-gnuxx11.cmake
new file mode 100644
index 000000000000..66337050c92f
--- /dev/null
+++ b/toolchains/mingw-gnuxx11.cmake
@@ -0,0 +1,13 @@
+# Sample toolchain file for building with gcc compiler
+#
+# Typical usage:
+#    *) cmake -H. -B_build -DCMAKE_TOOLCHAIN_FILE="%cd%\toolchains\mingw.cmake"
+
+# set compiler
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_CXX_COMPILER g++)
+
+# set c++ standard
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS YES)
diff --git a/toolchains/vs-14-2015-sdk-8-1.cmake b/toolchains/vs-14-2015-sdk-8-1.cmake
new file mode 100644
index 000000000000..463bee052386
--- /dev/null
+++ b/toolchains/vs-14-2015-sdk-8-1.cmake
@@ -0,0 +1,2 @@
+# set c++ standard
+set(CMAKE_SYSTEM_VERSION 8.1)
diff --git a/toolchains/vs-14-2015-win64.cmake b/toolchains/vs-14-2015-win64.cmake
new file mode 100644
index 000000000000..00beda25efd4
--- /dev/null
+++ b/toolchains/vs-14-2015-win64.cmake
@@ -0,0 +1 @@
+# dummy, nothing extra to set
diff --git a/toolchains/vs-15-2017-win64-cxx17.cmake b/toolchains/vs-15-2017-win64-cxx17.cmake
new file mode 100644
index 000000000000..5e4e936872d9
--- /dev/null
+++ b/toolchains/vs-15-2017-win64-cxx17.cmake
@@ -0,0 +1,2 @@
+# set c++ standard
+set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} /std:c++17")
diff --git a/toolchains/vs-15-2017-win64.cmake b/toolchains/vs-15-2017-win64.cmake
new file mode 100644
index 000000000000..00beda25efd4
--- /dev/null
+++ b/toolchains/vs-15-2017-win64.cmake
@@ -0,0 +1 @@
+# dummy, nothing extra to set