Skip to content

Commit

Permalink
build(cmake): disable warnings as errors on Clang (modules)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP committed Sep 26, 2023
1 parent 4fba8a4 commit 456f1ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/warnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
cmake_minimum_required(VERSION 3.15)

option(${projectPrefix}WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
if(${projectPrefix}BUILD_MODULES AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Workaround <https://github.com/llvm/llvm-project/issues/54574>.
set(${projectPrefix}WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
endif()

macro(_set_flags)
set(MSVC_WARNINGS
Expand Down Expand Up @@ -71,7 +75,7 @@ macro(_set_flags)
-Wdangling-else # warn about constructions where there may be confusion to which if statement an else branch belongs
)

set(CLANG_WARNINGS ${GCC_COMMON_WARNINGS})
set(CLANG_WARNINGS ${GCC_COMMON_WARNINGS} -Wno-error=read-modules-implicitly)

set(GCC_WARNINGS
${GCC_COMMON_WARNINGS}
Expand Down

0 comments on commit 456f1ff

Please sign in to comment.