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

Report the specific C++ standard at init time, stop warning about C++97/03 #740

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

giacomofiorin
Copy link
Member

We are using enough C++11 features now that it would be impossible for anybody to build without it. On the other hand, we may be having a similar situation with newer C++ standards.

I'm proposing to just print out the raw value of __cplusplus at init time, while also warning that this might be inaccurate on Windows builds. Folks use VMD much more than other codes on Windows, but VMD never took in my patch to fix the reporting problem:

# Tell MSVC to actually report the C++ version
target_compile_options(colvars PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>)

https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170

@giacomofiorin giacomofiorin force-pushed the cxx-standard-report branch 2 times, most recently from b08f0db to ea54333 Compare October 25, 2024 18:22
@giacomofiorin giacomofiorin merged commit baec93a into master Nov 8, 2024
15 checks passed
@giacomofiorin giacomofiorin deleted the cxx-standard-report branch November 8, 2024 22:18
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