From 95ff3bca617151411934922e99dc8dc348fa1192 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Thu, 30 Jul 2020 09:21:05 +0200 Subject: [PATCH] Add c++14 test run with travis-CI using clang-10. --- .travis.yml | 41 ++++++++++++++++++++++++++++++++++++++++- CMakeLists.txt | 7 ++++++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0173b9..b80afa6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ matrix: env: - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - ADDITIONAL_BUILD_OPTIONS="-DSAMPLES_BUILD=OFF" + - CXX_STANDARD="11" compiler: g++-5 - os: linux @@ -33,6 +34,7 @@ matrix: - libglu1-mesa-dev env: - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" + - CXX_STANDARD="11" compiler: g++-6 - os: linux @@ -47,6 +49,7 @@ matrix: - libglu1-mesa-dev env: - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + - CXX_STANDARD="11" compiler: g++-7 - os: linux @@ -61,6 +64,7 @@ matrix: - libglu1-mesa-dev env: - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" + - CXX_STANDARD="11" compiler: g++-8 - os: linux @@ -75,6 +79,7 @@ matrix: - libglu1-mesa-dev env: - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" + - CXX_STANDARD="11" compiler: g++-9 - os: linux @@ -89,6 +94,7 @@ matrix: - libglu1-mesa-dev env: - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" + - CXX_STANDARD="11" compiler: g++-10 - os: linux @@ -105,6 +111,8 @@ matrix: - ninja-build - xorg-dev - libglu1-mesa-dev + env: + - CXX_STANDARD="11" compiler: clang++-4.0 - os: linux @@ -121,6 +129,8 @@ matrix: - ninja-build - xorg-dev - libglu1-mesa-dev + env: + - CXX_STANDARD="11" compiler: clang++-5.0 - os: linux @@ -137,6 +147,8 @@ matrix: - ninja-build - xorg-dev - libglu1-mesa-dev + env: + - CXX_STANDARD="11" compiler: clang++-6.0 - os: linux @@ -153,6 +165,8 @@ matrix: - ninja-build - xorg-dev - libglu1-mesa-dev + env: + - CXX_STANDARD="11" compiler: clang++-7 - os: linux @@ -169,6 +183,8 @@ matrix: - ninja-build - xorg-dev - libglu1-mesa-dev + env: + - CXX_STANDARD="11" compiler: clang++-8 - os: linux @@ -185,6 +201,8 @@ matrix: - ninja-build - xorg-dev - libglu1-mesa-dev + env: + - CXX_STANDARD="11" compiler: clang++-9 - os: linux @@ -201,6 +219,26 @@ matrix: - ninja-build - xorg-dev - libglu1-mesa-dev + env: + - CXX_STANDARD="11" + compiler: clang++-10 + + - os: linux + before_install: + - sudo apt-get update + - sudo apt-get purge g++ + - sudo apt-get install clang-10 + - CC=clang-10 && CXX=clang++-10 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - ninja-build + - xorg-dev + - libglu1-mesa-dev + env: + - CXX_STANDARD="14" compiler: clang++-10 before_install: @@ -217,6 +255,7 @@ script: -DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON -DTESTS_BUILD_ONLY_DYNAMIC=ON -DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON - -DCMAKE_CXX_FLAGS="-std=c++11 -Wall -Wpedantic -Wextra" + -DCMAKE_CXX_FLAGS="-Wall -Wpedantic -Wextra" + -DCMAKE_CXX_STANDARD=$CXX_STANDARD $ADDITIONAL_BUILD_OPTIONS - cmake --build . diff --git a/CMakeLists.txt b/CMakeLists.txt index a265a90..2ee5e51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,12 @@ else(MSVC) add_compile_options(-Wall) endif(MSVC) -set(CMAKE_CXX_STANDARD 11) +if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) +endif() +set(CXX_STANDARD_REQUIRED ON) + +message("CMAKE_CXX_STANDARD = <${CMAKE_CXX_STANDARD}>") if (NOT DEFINED VulkanRegistry_DIR) if (DEFINED VULKAN_HPP_VULKAN_HEADERS_SRC_DIR)