Browse Source

Test different compiler versions

Jorrit Rouwe 4 years ago
parent
commit
2edda73833
3 changed files with 5 additions and 7 deletions
  1. 4 3
      .github/workflows/build.yml
  2. 0 3
      Build/CMakeLists.txt
  3. 1 1
      Build/cmake_linux_clang.sh

+ 4 - 3
.github/workflows/build.yml

@@ -22,16 +22,17 @@ jobs:
         fail-fast: false
         matrix:
             build_type: [Debug, Release, Distribution, ReleaseASAN, ReleaseUBSAN]
+            clang_version: [clang++-10, clang++-11, clang++-12]
 
     steps:
     - name: Checkout Code
       uses: actions/checkout@v2
     - name: Configure CMake
-      run: cmake -B ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} Build
+      run: cmake -B ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_COMPILER=${{matrix.clang_version}} Build
     - name: Build
-      run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} --config ${{matrix.build_type}}
+      run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}} --config ${{matrix.build_type}}
     - name: Test
-      working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
+      working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}_${{matrix.clang_version}}
       run: ctest --output-on-failure
 
   msvc_cl:

+ 0 - 3
Build/CMakeLists.txt

@@ -44,9 +44,6 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
 		set(CMAKE_EXE_LINKER_FLAGS_RELEASECOVERAGE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LIBPATH:${CLANG_LIB_PATH}")
 	endif()
 elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
-	# Switch to clang compiler
-	set(CMAKE_CXX_COMPILER "clang++")
-
 	# Set general compiler flags (do not use -ffast-math since it cannot be turned off in a single compilation unit)
 	set(CMAKE_CXX_FLAGS "-std=c++17 -I. -Wall -Werror")
 

+ 1 - 1
Build/cmake_linux_clang.sh

@@ -14,6 +14,6 @@ echo Usage: ./cmake_linux_clang.sh [Configuration]
 echo "Possible configurations: Debug (default), Release, Distribution, ReleaseUBSAN, ReleaseASAN, ReleaseCoverage"
 echo Generating Makefile for build type \"$BUILD_TYPE\" in folder \"$BUILD_DIR\"
 
-cmake -S . -B $BUILD_DIR -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE
+cmake -S . -B $BUILD_DIR -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_COMPILER=clang++
 
 echo Compile by running \"make -j 8 \&\& ./UnitTests\" in folder \"$BUILD_DIR\"