From af113b5e9c418df775644652e6b5ca59ab1fcd20 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 19 Aug 2019 18:33:08 +0200 Subject: [PATCH] CMake: Set warning level and disable -Waddress-of-packet-member (#7693) * CMake: Set warning level and disable -Waddress-of-packet-member Mavlink fails terribly on the check for -Waddress-of-packet-member but this is not a problem of QGC, if I don't remove this warning it's impossible to look at the terminal for QGC warnings. This needs to be fixed however, but this is not the place. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21974be99..05d4549e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,10 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_compile_options(-Wall -Wextra -Wno-address-of-packed-member) +endif() + # CMake build type # Debug Release RelWithDebInfo MinSizeRel Coverage if (NOT CMAKE_BUILD_TYPE) -- 2.22.0