Skip to content

Commit

Permalink
Only use -Werror=implicit if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRhiem committed Mar 1, 2021
1 parent a4338d9 commit a231e58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ project(
)

include(GNUInstallDirs)
include(CheckCXXCompilerFlag)

# Honor `C_VISIBILITY_PRESET hidden` in static libraries
cmake_policy(SET CMP0063 NEW)

if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
check_cxx_compiler_flag("-Werror=implicit" ERROR_IMPLICIT_SUPPORTED)
if(ERROR_IMPLICIT_SUPPORTED)
set(COMPILER_OPTION_ERROR_IMPLICIT
"-Werror=implicit"
CACHE INTERNAL "Compiler flag for generating errors on implicit declarations"
Expand Down

0 comments on commit a231e58

Please sign in to comment.