Skip to content
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

Do not include compiler warning flags in the compile option of the cmake target #4989

Merged
merged 1 commit into from
May 2, 2022

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Apr 29, 2022

When configuring with -DKokkos_ENABLE_COMPILER_WARNINGS=ON (which developers will typically do), the cmake target installed has the warning flags as compile options. These are then passed downstream transitively which is just wrong. It gets irritating at times, I had to reconfigure and reinstall Kokkos (or edit the target) too many times.
In other words, this PR makes a develop build suitable to use downstream.

@dalg24 dalg24 force-pushed the do_not_export_warning_flags branch from 9c8f4b5 to edba2d4 Compare April 29, 2022 13:45
@dalg24 dalg24 requested a review from nmm0 April 29, 2022 15:53
Copy link
Contributor

@nmm0 nmm0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but I think in the future we should switch to CMakePresets.json for developer configurations. We could have compiler-specific presets that devs can inherit from. This will also ensure that we have a common set of development environments that people use.

ELSE()
STRING(REPLACE ";" " " WARNING_FLAGS "${COMMON_WARNINGS}")
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure no one is using this flag downstream because it can break subdirectory projects. At the very least we should document it.

@dalg24 dalg24 merged commit 14bdcee into kokkos:develop May 2, 2022
@dalg24 dalg24 deleted the do_not_export_warning_flags branch May 2, 2022 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants