cmake: Add compiler property for disabling pointer arithmetic warnings

Add a compiler property for disabling pointer arithmetic warnings,
and implement that property for GCC.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
This commit is contained in:
Yonatan Schachter 2022-02-16 21:02:08 +02:00 committed by Carles Cufí
commit 0f73144ee9
2 changed files with 6 additions and 0 deletions

View file

@ -108,3 +108,6 @@ set_property(TARGET compiler-cpp PROPERTY no_threadsafe_statics)
# Required ASM flags when compiling
set_property(TARGET asm PROPERTY required)
# Compiler flag for disabling pointer arithmetic warnings
set_compiler_property(PROPERTY warning_no_pointer_arithmetic)

View file

@ -189,3 +189,6 @@ set_property(TARGET asm PROPERTY required "-xassembler-with-cpp")
if (NOT COMPILER STREQUAL "xcc")
set_compiler_property(PROPERTY diagnostic -fdiagnostics-color=always)
endif()
# Compiler flag for disabling pointer arithmetic warnings
set_compiler_property(PROPERTY warning_no_pointer_arithmetic "-Wno-pointer-arith")