Skip to content

Commit

Permalink
cmake: Treat warnings as errors on Clang and GNU GCC
Browse files Browse the repository at this point in the history
Deprecation warnings are not treated as errors.

-Wformat-securityis enabled, some Linux packages build system have it
enabled.
obsproject#5766
  • Loading branch information
tytan652 committed Jul 18, 2022
1 parent 8ead718 commit e31ecaf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/Modules/CompilerConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ else()
endif()

add_compile_options(
-Werror
-Wextra
-Wvla
-Wformat
-Wformat-security
-Wno-unused-function
-Wno-missing-field-initializers
-Wno-error=deprecated-declarations
-fno-strict-aliasing
"$<$<COMPILE_LANGUAGE:C>:-Werror-implicit-function-declaration;-Wno-missing-braces>"
"$<$<BOOL:${USE_LIBCXX}>:-stdlib=libc++>"
Expand Down

0 comments on commit e31ecaf

Please sign in to comment.