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

remove cmake logic for -fconcepts and -fconcepts-ts flags #379

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from

Conversation

nmm0
Copy link
Contributor

@nmm0 nmm0 commented Feb 14, 2025

I'm suggesting that we remove the logic in our cmake that tries to add the -fconcepts and -fconcepts-ts flags.

First of all, the -fconcepts-ts branch is broken, because the condition checks COMPILER_SUPPORTS_FCONCEPTS instead of COMPILER_SUPPORTS_FCONCEPTS_TS, so it wasn't used anyway.

Secondly, pretty much every modern compiler will enable this if you enable -std=c++20, and we only add this flag if we enable -std=c++20. In the rare cases someone is trying to build mdspan on a platform that doesn't do this, they can simply add -DCMAKE_CXX_FLAGS=-fconcepts to their cmake command line invocation or preset.

Note that us manually adding this flag breaks builds in small niche use cases (that can easily be worked around); i.e. when using CMAKE_CXX_CLANG_TIDY with gcc as clang does not recognize the flag but it is forced on. So the motivation for this is pretty minor but I think it would be good to clean up some of our cmake anyway.

…pts-ts` branch was broken and the flag is enabled by default in C++20 mode
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.

1 participant