From 4d04c9cb94ae5274c7d4c894f5edd90d21a9a1a8 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Sun, 8 Jun 2014 21:42:27 +0100 Subject: [PATCH] Suppress some annoying warnings about offsetof. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80836dc..df6564f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,7 +344,10 @@ IF(CMAKE_COMPILER_IS_GNUCC) IF(AQUARIA_GCC_HAS_STACKPROT) ADD_DEFINITIONS(-fno-stack-protector) ENDIF(AQUARIA_GCC_HAS_STACKPROT) - + + # We knowingly apply offsetof to non-POD types. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof") + # -O3 breaks on some GCC/MinGW versions, make sure CMake does not set this as default. # Exceptions are not used, excluding support for release builds adds less bulk as well. set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG" CACHE STRING "Flags used for release builds" FORCE)