Ensure no left over state is left in the required flags variable #32
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.
I'm raising this PR to fix a bug when using the code coverage modules with a build that includes the HDF5 library. HDF5 uses the
CMAKE_REQUIRED_FLAGS
with try_compile, however, because it appends toCMAKE_REQUIRED_FLAGS
its is picking up the leftover code coverage flags from the coverage module. All of the calls totry_compile
now fail because gcov is not added as a linker flag as well:While is this arguably an error with the way HDF5 uses
CMAKE_REQUIRED_FLAGS
I think it makes sense to fix this here, because there may be other libraries out in the wild that makes similar assumptions about the usage ofCMAKE_REQUIRED_FLAGS
. Additionally, as this is the location the values originate from, and they are not longer needed after the check this seems the correct place to address the issue by resetting the values to their default state.