Skip to content

Commit

Permalink
Do not use own warning-as-error logic, if standard CMake flag is in us.
Browse files Browse the repository at this point in the history
If CMAKE_COMPILE_WARNING_AS_ERROR is set, ígnore DIY logic.
CMAKE_COMPILE_WARNING_AS_ERROR is available since CMake 3.24

-DCMAKE_COMPILE_WARNING_AS_ERROR=0 will also help to avoid currently
unconditional "warning is error" when building standalone or via
ExternalProject_Add
  • Loading branch information
vaintroub committed Jan 24, 2024
1 parent 83951fe commit 3956415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ ENDIF()
MESSAGE1(SYSTEM_LIBS "SYSTEM_LIBS ${SYSTEM_LIBS}")
MARK_AS_ADVANCED(SYSTEM_LIBS)

IF(NOT IS_SUBPROJECT)
IF(NOT IS_SUBPROJECT AND (NOT DEFINED CMAKE_COMPILE_WARNING_AS_ERROR))
IF ((NOT WIN32) AND (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "GNU"))
SET(WARNING_AS_ERROR "-Werror")
ELSEIF(CMAKE_C_COMPILER_ID MATCHES "MSVC")
Expand Down

0 comments on commit 3956415

Please sign in to comment.