Skip to content

Commit

Permalink
Fix failing compilation tests in g++11
Browse files Browse the repository at this point in the history
Request `-std=c++11` explicitly in tests meant to compile against that
standard.
  • Loading branch information
ricab committed May 16, 2021
1 parent 9bc5d5f commit 2c553c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ set(CMAKE_REQUIRED_FLAGS "-std=c++1z") # only for this check
CHECK_CXX_SYMBOL_EXISTS(__cpp_noexcept_function_type "" HAS_NOEXCEPT_IN_TYPE)
unset(CMAKE_REQUIRED_FLAGS)

# request C++11 explicitly by default - works around newer compilers otherwise
# omitting `-std=c++11` despite 11 being requested with target_compile_features
set(CMAKE_CXX_STANDARD 11)

# compiler warnings
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(clang_warnings "-Weverything -pedantic -Wno-c++98-compat \
Expand Down

0 comments on commit 2c553c0

Please sign in to comment.