[common] detect clang and disable warnings for unknown-warning-option

Clang doesn't know the warning option `format-truncation`, which GCC
falsely triggers on when calling vsnprintf. Further to this, GCC doesn't
understand the warning group `unknown-warning-option`, as such we must
disable these warnings in the cmake.
This commit is contained in:
Geoffrey McRae 2021-02-22 01:54:46 +11:00
parent e79661a924
commit 6358f35cb7

View File

@ -11,6 +11,12 @@ if(ENABLE_BACKTRACE)
add_definitions(-DENABLE_BACKTRACE)
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(
"-Wno-unknown-warning-option"
)
endif()
add_subdirectory(src/platform)
set(COMMON_SOURCES