dbus/cmake/modules
Alex Richardson d35554c111 cmake: Only add warning flags if the compiler supports them
I am compiling for FreeBSD where the compiler is Clang and doesn't accept
all the GCC warning flags. This breaks the -Werror build:
```
error: unknown warning option '-Wduplicated-branches' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wduplicated-cond' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wjump-misses-init' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wrestrict' [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wunused-but-set-variable'; did you mean '-Wunused-const-variable'? [-Werror,-Wunknown-warning-option]
```

With this change we use check_{c,cxx}_compiler_flag to check if the flag
is supported before adding it. In the future this will allow adding
clang-specific warning flags to the list of warnings as well since they
will be ignored for GCC.
2022-03-29 12:21:46 +00:00
..
CheckPrototypeExists.cmake * cmake: new directory, contains cmake build support. 2007-03-03 14:32:17 +00:00
CheckStructMember.cmake * cmake: new directory, contains cmake build support. 2007-03-03 14:32:17 +00:00
COPYING-CMAKE-SCRIPTS Add glib support to cmake buildsystem. 2014-01-07 19:06:26 +01:00
CPackInstallConfig.cmake Remove obsolete parameter in end... cmake keywords 2019-01-24 09:07:27 +01:00
FindDocBookXSL.cmake FindDocBookXSL.cmake: Add 2018-11-20 18:29:39 +00:00
FindDoxygen.cmake * cmake: added doxygen support 2007-03-14 00:16:05 +00:00
FindGLIB2.cmake cmake: fix find_package related naming mismatch for GLIB2 2021-11-10 00:49:21 +01:00
FindLibIconv.cmake * cmake: new directory, contains cmake build support. 2007-03-03 14:32:17 +00:00
MacroGetenvWinPath.cmake Remove obsolete parameter in end... cmake keywords 2019-01-24 09:07:27 +01:00
MacroLibrary.cmake Use lower case cmake keywords 2019-01-23 21:34:24 +01:00
MacroOptionalFindPackage.cmake * cmake: new directory, contains cmake build support. 2007-03-03 14:32:17 +00:00
Macros.cmake cmake: Only add warning flags if the compiler supports them 2022-03-29 12:21:46 +00:00
MacrosAutotools.cmake Remove obsolete parameter in end... cmake keywords 2019-01-23 21:34:24 +01:00
ProjectSourceGroup.cmake Remove obsolete parameter in end... cmake keywords 2019-01-23 21:34:24 +01:00
Win32Macros.cmake Remove obsolete parameter in end... cmake keywords 2019-01-23 21:34:24 +01:00