-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
164 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
include_guard(GLOBAL) | ||
|
||
set(WHIRLWIND_CXX_WARNINGS) | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) | ||
set(WHIRLWIND_CXX_WARNINGS | ||
# cmake-format: sortable | ||
-Wall | ||
-Wcast-align | ||
-Wcast-qual | ||
-Wconversion | ||
-Wdouble-promotion | ||
-Wduplicated-branches | ||
-Werror | ||
-Wextra | ||
-Wlogical-op | ||
-Wnon-virtual-dtor | ||
-Wold-style-cast | ||
-Wpedantic | ||
-Wshadow | ||
-Wsign-conversion | ||
-Wundef | ||
) | ||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") | ||
set(WHIRLWIND_CXX_WARNINGS | ||
# cmake-format: sortable | ||
-Wall | ||
-Wbad-function-cast | ||
-Wcast-function-type | ||
-Wcast-qual | ||
-Wconditional-uninitialized | ||
-Wconversion | ||
-Wcuda-compat | ||
-Wdeprecated | ||
-Wdouble-promotion | ||
-Wduplicate-decl-specifier | ||
-Wduplicate-method-arg | ||
-Wduplicate-method-match | ||
-Werror | ||
-Wextra | ||
-Wextra-semi | ||
-Wheader-hygiene | ||
-Wimplicit | ||
-Winconsistent-missing-destructor-override | ||
-Wloop-analysis | ||
-Wnarrowing | ||
-Wnon-virtual-dtor | ||
-Wold-style-cast | ||
-Woverriding-method-mismatch | ||
-Wpedantic | ||
-Wpointer-arith | ||
-Wshadow | ||
-Wstatic-in-inline | ||
-Wswitch-enum | ||
-Wundefined-reinterpret-cast | ||
-Wunreachable-code-aggressive | ||
-Wunused-member-function | ||
-Wunused-template | ||
-Wvector-conversion | ||
) | ||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL MSVC) | ||
set(WHIRLWIND_CXX_WARNINGS /W3 /WX) | ||
endif() | ||
|
||
# Define an interface-only target with a list of desired C++ compiler warning flags | ||
# enabled. The flags can then be applied to any compiled target by linking with the | ||
# interface target via `target_link_libraries()`. | ||
add_library(whirlwind-warnings INTERFACE) | ||
add_library(whirlwind::warnings ALIAS whirlwind-warnings) | ||
target_compile_options( | ||
whirlwind-warnings INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${WHIRLWIND_CXX_WARNINGS}> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.