Re-work CI and error suppression

This commit is contained in:
Dmitry Kobets 2021-12-02 14:28:25 -08:00
parent 4430ba9663
commit 03af2432e0
3 changed files with 12 additions and 19 deletions

View File

@ -11,24 +11,23 @@ jobs:
matrix: matrix:
14_debug: 14_debug:
GSL_CXX_STANDARD: '14' GSL_CXX_STANDARD: '14'
CMAKE_CXX_STANDARD: '14'
BUILD_TYPE: 'Debug' BUILD_TYPE: 'Debug'
14_release: 14_release:
GSL_CXX_STANDARD: '14' GSL_CXX_STANDARD: '14'
CMAKE_CXX_STANDARD: '14'
BUILD_TYPE: 'Release' BUILD_TYPE: 'Release'
17_debug: 17_debug:
GSL_CXX_STANDARD: '17' GSL_CXX_STANDARD: '17'
CMAKE_CXX_STANDARD: '17'
BUILD_TYPE: 'Debug' BUILD_TYPE: 'Debug'
17_release: 17_release:
GSL_CXX_STANDARD: '17' GSL_CXX_STANDARD: '17'
CMAKE_CXX_STANDARD: '17'
BUILD_TYPE: 'Release' BUILD_TYPE: 'Release'
# Note: Currently, only some C++20 features are supported by GSL
20_debug: 20_debug:
GSL_CXX_STANDARD: '17' GSL_CXX_STANDARD: '20'
CMAKE_CXX_STANDARD: '20'
BUILD_TYPE: 'Debug' BUILD_TYPE: 'Debug'
20_release:
GSL_CXX_STANDARD: '20'
BUILD_TYPE: 'Release'
continueOnError: false continueOnError: false
steps: steps:
- template: ./steps.yml - template: ./steps.yml

View File

@ -3,7 +3,7 @@ steps:
name: Configure name: Configure
inputs: inputs:
workingDirectory: build workingDirectory: build
cmakeArgs: '-DCMAKE_CXX_STANDARD=$(CMAKE_CXX_STANDARD) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -Werror=dev .. ' cmakeArgs: '-DGSL_CXX_STANDARD=$(GSL_CXX_STANDARD) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -Werror=dev .. '
- task: CMake@1 - task: CMake@1
name: Build name: Build

View File

@ -54,7 +54,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
find_package(Microsoft.GSL REQUIRED) find_package(Microsoft.GSL REQUIRED)
endif() endif()
if (MSVC AND (GSL_CXX_STANDARD EQUAL 17)) if (MSVC AND (GSL_CXX_STANDARD GREATER_EQUAL 17))
set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-) set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-)
endif() endif()
@ -130,17 +130,16 @@ else()
-Wno-unused-member-function -Wno-unused-member-function
-Wno-unused-variable -Wno-unused-variable
> >
$<$<BOOL:${CMAKE_CXX_STANDARD}>:
$<$<EQUAL:${CMAKE_CXX_STANDARD},20>:
-Wno-zero-as-null-pointer-constant # Very noisy, minor, and just so
-Wno-sign-conversion # happens to trigger on googletest
>
>
> >
$<$<CXX_COMPILER_ID:Clang>: $<$<CXX_COMPILER_ID:Clang>:
$<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.99>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6>>: $<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.99>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6>>:
$<$<EQUAL:${GSL_CXX_STANDARD},17>:-Wno-undefined-func-template> $<$<EQUAL:${GSL_CXX_STANDARD},17>:-Wno-undefined-func-template>
> >
$<$<AND:$<EQUAL:${GSL_CXX_STANDARD},20>,$<CXX_COMPILER_VERSION:11.0.0>>:
-Wno-zero-as-null-pointer-constant # failing Clang Ubuntu 20.04 tests, seems to be a bug with clang 11.0.0
# (operator< is being re-written by the compiler as operator<=> and
# raising the warning)
>
> >
$<$<CXX_COMPILER_ID:AppleClang>: $<$<CXX_COMPILER_ID:AppleClang>:
$<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,9.1>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,10>>: $<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,9.1>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,10>>:
@ -238,11 +237,6 @@ else()
-Wpedantic -Wpedantic
-Wshadow -Wshadow
-Wsign-conversion -Wsign-conversion
$<$<BOOL:${CMAKE_CXX_STANDARD}>: # happens to trigger on googletest
$<$<EQUAL:${CMAKE_CXX_STANDARD},20>:
-Wno-sign-conversion # happens to trigger on googletest
>
>
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>: $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Weverything -Weverything
-Wno-c++98-compat -Wno-c++98-compat