From 6358f35cb711ad632d07316910cb6ea5ecbd7286 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 22 Feb 2021 01:54:46 +1100 Subject: [PATCH] [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. --- common/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index ea7bb73d..420c2863 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -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