Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Switch compiler standard to std:c++latest #1365

Merged
merged 4 commits into from
Jan 3, 2024
Merged

Switch compiler standard to std:c++latest #1365

merged 4 commits into from
Jan 3, 2024

Conversation

Randalphwa
Copy link
Collaborator

This PR removes the C++20 requirement from CMakeLists.txt and places the check in the precompiled header instead. That made it possible to use -std::c++latest as the compiler. With MSVC, that's going to be C++23 which resulted in some errors that needed fixing. By always using the latest standard, we can avoid having compiler problems due to changing standards in the future.

Note that c++latest can not be used currently for compiling the wxWidgets library -- that will require fixes to wxWidgets itself.

These versions take two parameters with the second parameter having a
default. The advantage of these versions is you can search case-insensitively.
Since CMake will no longer require this directly (it uses std::c++latest instead)
there has to be a check in the precompiled header that will fail with a compiler
that is too old.
std::unique_ptr<WakaTime> fails under C++23.
The precompiled header prevents compiling the project with an older
version. This verifies that versions beyond the required version will still
work.
@Randalphwa Randalphwa merged commit 06c4d88 into main Jan 3, 2024
@Randalphwa Randalphwa deleted the cpp_version branch January 3, 2024 01:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant