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

CMake: Do not fail on unknown compiler features #3453

Merged
merged 1 commit into from
May 22, 2023
Merged

Conversation

glebm
Copy link
Contributor

@glebm glebm commented May 21, 2023

If CMake does not know much about a compiler, target_compile_features will fail. Issue a warning instead.

CMakeLists.txt Outdated
Comment on lines 300 to 304
if(cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
target_compile_features(fmt PUBLIC cxx_std_11)
else()
message(WARNING "Feature cxx_std_11 is unknown for the CXX compiler")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we use spaces after control flow CMake commands like if/else/endif, e.g.

if (...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

If CMake does not know much about a compiler, `target_compile_features` will fail. Issue a warning instead.
@vitaut vitaut merged commit a54cb10 into fmtlib:master May 22, 2023
@vitaut
Copy link
Contributor

vitaut commented May 22, 2023

Thanks

@glebm glebm deleted the patch-1 branch May 23, 2023 00:28
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.

2 participants