Mark includes of eigen3 headers as SYSTEM in CMakeLists.txt #570
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses our quite complex workaround to silence compiler warnings originating from external packages such as
eigen3.We have silenced the warnings by wrapping the include statements for
eigen3headers between the headersbegin_ignore_warnings_eigen.hppandend_ignore_warnings.hppand every "annoying" compiler warning is explicitly stated in there.CMake actually offers a cleaner solution for this. In the
include_directoriesfunction, one can pass theSYSTEMkeyword (cf. CMake docs - target_include_directories). This will tell the compiler (if supported) to treat these headers as system header and warnings originating from code in their is suppressed.This PR sets the SYSTEM keyword for the
Eigen3library and deletes thebegin_ignore_warnings_eigen.hppand its usages. I have tested it with clang and there are no compiler warnings related to eigen3 code. I am not sure though how good this solution works with intel compilers.I guess that similar improvements could be made for the other external packages, such as
pybind11in which we silence the warnings in the same fashion.