-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only add warning flags for tests and examples.
The CMake code uses an interface target `HighFiveWarnings` which collects all warnings we want when building the examples and tests. However, we no longer set these warnings for users of HighFive, since they might have different preferences w.r.t. which flags should be set.
- Loading branch information
Showing
6 changed files
with
52 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
if(TARGET HighFiveWarnings) | ||
# Allow multiple `include(HighFiveWarnings)`, which would | ||
# attempt to redefine `HighFiveWarnings` and fail without | ||
# this check. | ||
return() | ||
endif() | ||
|
||
add_library(HighFiveWarnings INTERFACE) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" | ||
OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" | ||
OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") | ||
|
||
target_compile_options(HighFiveWarnings | ||
INTERFACE | ||
-Wall | ||
-Wextra | ||
-Wshadow | ||
-Wnon-virtual-dtor | ||
-Wunused | ||
-Woverloaded-virtual | ||
-Wformat=2 | ||
-Wconversion | ||
-Wsign-conversion | ||
-Wno-error=deprecated-declarations | ||
) | ||
|
||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Intel") | ||
target_compile_options(HighFiveWarnings | ||
INTERFACE | ||
-Wpedantic | ||
-Wcast-align | ||
-Wdouble-promotion | ||
) | ||
endif() | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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