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:
14_debug:
GSL_CXX_STANDARD: '14'
CMAKE_CXX_STANDARD: '14'
BUILD_TYPE: 'Debug'
14_release:
GSL_CXX_STANDARD: '14'
CMAKE_CXX_STANDARD: '14'
BUILD_TYPE: 'Release'
17_debug:
GSL_CXX_STANDARD: '17'
CMAKE_CXX_STANDARD: '17'
BUILD_TYPE: 'Debug'
17_release:
GSL_CXX_STANDARD: '17'
CMAKE_CXX_STANDARD: '17'
BUILD_TYPE: 'Release'
# Note: Currently, only some C++20 features are supported by GSL
20_debug:
GSL_CXX_STANDARD: '17'
CMAKE_CXX_STANDARD: '20'
GSL_CXX_STANDARD: '20'
BUILD_TYPE: 'Debug'
20_release:
GSL_CXX_STANDARD: '20'
BUILD_TYPE: 'Release'
continueOnError: false
steps:
- template: ./steps.yml

View File

@ -3,7 +3,7 @@ steps:
name: Configure
inputs:
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
name: Build

View File

@ -54,7 +54,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
find_package(Microsoft.GSL REQUIRED)
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-)
endif()
@ -130,17 +130,16 @@ else()
-Wno-unused-member-function
-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>:
$<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.99>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6>>:
$<$<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>:
$<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,9.1>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,10>>:
@ -238,11 +237,6 @@ else()
-Wpedantic
-Wshadow
-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>>:
-Weverything
-Wno-c++98-compat