From afe04691aca3f669f517adaeb5bd4a87a481fb4a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 27 May 2020 01:26:30 +0100 Subject: Squashed 'third_party/glog/' content from commit 9ef754a3023 git-subtree-dir: third_party/glog git-subtree-split: 9ef754a3023e6fd10f20fe53dfca96dd898182e3 --- toolchains/.gitignore | 2 ++ toolchains/clang-cxx17.cmake | 13 +++++++++++++ toolchains/gcc-cxx11.cmake | 13 +++++++++++++ toolchains/gcc-cxx17.cmake | 13 +++++++++++++ toolchains/gcc-cxx98.cmake | 13 +++++++++++++ toolchains/gcc-gnuxx11.cmake | 13 +++++++++++++ toolchains/linux-mingw-w64-cxx11.cmake | 33 ++++++++++++++++++++++++++++++++ toolchains/linux-mingw-w64-cxx17.cmake | 33 ++++++++++++++++++++++++++++++++ toolchains/linux-mingw-w64-gnuxx11.cmake | 33 ++++++++++++++++++++++++++++++++ toolchains/mingw-cxx11.cmake | 13 +++++++++++++ toolchains/mingw-cxx17.cmake | 13 +++++++++++++ toolchains/mingw-gnuxx11.cmake | 13 +++++++++++++ toolchains/vs-14-2015-sdk-8-1.cmake | 2 ++ toolchains/vs-14-2015-win64.cmake | 1 + toolchains/vs-15-2017-win64-cxx17.cmake | 2 ++ toolchains/vs-15-2017-win64.cmake | 1 + 16 files changed, 211 insertions(+) create mode 100644 toolchains/.gitignore create mode 100644 toolchains/clang-cxx17.cmake create mode 100644 toolchains/gcc-cxx11.cmake create mode 100644 toolchains/gcc-cxx17.cmake create mode 100644 toolchains/gcc-cxx98.cmake create mode 100644 toolchains/gcc-gnuxx11.cmake create mode 100644 toolchains/linux-mingw-w64-cxx11.cmake create mode 100644 toolchains/linux-mingw-w64-cxx17.cmake create mode 100644 toolchains/linux-mingw-w64-gnuxx11.cmake create mode 100644 toolchains/mingw-cxx11.cmake create mode 100644 toolchains/mingw-cxx17.cmake create mode 100644 toolchains/mingw-gnuxx11.cmake create mode 100644 toolchains/vs-14-2015-sdk-8-1.cmake create mode 100644 toolchains/vs-14-2015-win64.cmake create mode 100644 toolchains/vs-15-2017-win64-cxx17.cmake create mode 100644 toolchains/vs-15-2017-win64.cmake (limited to 'toolchains') 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 -- cgit 1.4.1