Skip to content

Commit

Permalink
CMake: fix cxx flag check
Browse files Browse the repository at this point in the history
Oops...

Fixes #2224
  • Loading branch information
dweindl committed Dec 4, 2023
1 parent 81872cc commit b6219be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CMakeLists.template.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

include(CheckCXXCompilerFlag)
set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable)
set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable -Werror)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable)
endif()
foreach(flag ${MY_CXX_FLAGS})
unset(CUR_FLAG_SUPPORTED CACHE)
check_cxx_compiler_flag(-Werror ${flag} CUR_FLAG_SUPPORTED)
check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED)
if(${CUR_FLAG_SUPPORTED})
string(APPEND CMAKE_CXX_FLAGS " ${flag}")
endif()
Expand Down

0 comments on commit b6219be

Please sign in to comment.