-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add KIVA_WERROR option to interpret compiler warnings as errors #55
Conversation
|
I go back and forth on the default. I think I want it on by default, and then executables linking to Kiva can decide if they want to turn it off. Definitely needs to be on for the CI, otherwise it won't keep us from merging warnings. |
Codecov Report
@@ Coverage Diff @@
## develop #55 +/- ##
========================================
Coverage 59.19% 59.19%
========================================
Files 21 21
Lines 5065 5065
========================================
Hits 2998 2998
Misses 2067 2067
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
CMakeLists.txt
Outdated
@@ -8,6 +8,7 @@ option(ENABLE_OPENMP "Use OpenMP" OFF) | |||
option( KIVA_GROUND_PLOT "Build ground plotting library" ON ) | |||
mark_as_advanced(FORCE BUILD_GROUND_PLOT) | |||
option( KIVA_TESTING "Build tests" ON ) | |||
option( KIVA_WERROR "Turn on warnings into error" ON ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed my mind on this one. Let's make it default to OFF, and handle things similarly to the fmt repository.
cmake/compiler-flags.cmake
Outdated
$<$<CXX_COMPILER_ID:GNU>: | ||
-Wall | ||
-Wextra | ||
-Wpedantic | ||
$<$<BOOL:${KIVA_WERROR}>: | ||
-Werror # Turn warnings into errors | ||
> | ||
> | ||
|
||
$<$<CXX_COMPILER_ID:Clang>: | ||
-Wall | ||
-Wextra | ||
-Wpedantic | ||
$<$<BOOL:${KIVA_WERROR}>: | ||
-Werror # Turn warnings into errors | ||
> | ||
> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is WET.
@nealkruis I tested that the interface library was only applied to the corresponding target by:
I went back and added the ability to turn on Do you agree with this conclusion? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting very close. I left two comments, but I think we are also missing a link to the common interface on one of the targets.
src/libgroundplot/CMakeLists.txt
Outdated
@@ -5,16 +5,10 @@ set(groundplot_src GroundPlot.cpp | |||
|
|||
add_library(groundplot STATIC ${groundplot_src}) | |||
|
|||
target_link_libraries(groundplot fmt mgl-static libkiva) | |||
target_link_libraries(groundplot fmt mgl-static libkiva kiva_common_interface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No keyword?
src/kiva/CMakeLists.txt
Outdated
@@ -12,16 +12,10 @@ set(CMAKE_INSTALL_RPATH "@executable_path") | |||
|
|||
add_executable(kiva ${kiva_src}) | |||
|
|||
target_link_libraries(kiva libkiva groundplot boost_program_options yaml-cpp) | |||
target_link_libraries(kiva libkiva groundplot boost_program_options yaml-cpp kiva_common_interface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No keyword?
Description
The goal is to have the option to turn warnings into errors by
Major changes: