diff options
author | gue5t <gue5t@midori.launchpad> | 2015-08-15 18:40:06 -0500 |
---|---|---|
committer | gue5t <gue5t@midori.launchpad> | 2015-08-15 18:40:06 -0500 |
commit | 4b639dfadb8c2f8eb79ddf30b177f61fb29e5bd6 (patch) | |
tree | b94815bc0f882c4293f5bfd16e66cacfd2f441c9 /CMakeLists.txt | |
parent | 3a8e148ff36fcc51266ef9af9ea54db90b658a75 (diff) | |
download | midori-git-4b639dfadb8c2f8eb79ddf30b177f61fb29e5bd6.tar.gz |
Only enable warnings for Vala with recent versions of GCC and Clang
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 11465d7a..ae600cda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,7 +261,19 @@ else () endif () # Explicitly add -fPIC for older toolchains -set(VALA_CFLAGS "-g -fPIC -Werror=implicit-function-declaration -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -Wno-deprecated-declarations") +set(VALA_CFLAGS "-g -fPIC") + +# With compiler versions that can, enable exactly the non-spurious warnings +# in Vala-generated C, otherwise disable warnings +if ((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "5.0.0") + OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "3.0.0")) + set(VALA_CFLAGS "${VALA_CFLAGS} -Werror=implicit-function-declaration") + set(VALA_CFLAGS "${VALA_CFLAGS} -Wno-incompatible-pointer-types") + set(VALA_CFLAGS "${VALA_CFLAGS} -Wno-discarded-qualifiers") + set(VALA_CFLAGS "${VALA_CFLAGS} -Wno-deprecated-declarations") +else () + set(VALA_CFLAGS "${VALA_CFLAGS} -w") +endif () set(LIBMIDORI "${CMAKE_PROJECT_NAME}-core") |