fix: Enable use of C++20 for compatibility with poppler 24.05#961
Merged
kaamui merged 1 commit intoOpenBoard-org:devfrom May 14, 2024
Merged
fix: Enable use of C++20 for compatibility with poppler 24.05#961kaamui merged 1 commit intoOpenBoard-org:devfrom
kaamui merged 1 commit intoOpenBoard-org:devfrom
Conversation
Collaborator
|
Accepting this PR would break builds for several other distro versions:
If your proposed alternative solution 1 (cache variable) is feasible, then I would very much prefer this, as it does not affect or break other builds. |
Contributor
Author
|
I thought as much, though I didn't expect Leap to still default to 7.5. But doesn't matter. As for solution 1 - which I think is the next best solution - looks probably something like this: |
poppler 24.05 exposes std::string::starts_with in its headers which requires C++20. Requiring C++20 means dropping support for still maintained distributions. As such, the C++ standard defaults to the current C++17, but can be overridden where necessary. Emit a status message showing the chosen C++ standard for debug purposes.
Contributor
Author
|
@letsfindaway I've pushed the update. Tested with C++17, C++20, and default (C++17). |
Collaborator
|
I would like to clarify the problem #958 (comment) before merging. |
Contributor
Author
|
With #962 merged, I believe this PR can proceed. @letsfindaway Any thoughts? |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Poppler uses
std::string::starts_withsince poppler/poppler@fbb645. This commit (fbb645) is included inpoppler 24.05. This change also affects the public headers of GooString, which means that all projects depending onpopplerneed to be aware ofstd::string::starts_with, even if they don't use it themselves.std::string::starts_withis new with C++ 20 (see above), which means that OpenBoard must also be compiled with C++ 20. Otherwise, this error occurs:Possible solutions
poppler. I haven't found a way to cleanly achieve this. Might mean that devs have to test with different versions of poppler.Solution presented in this PR
Solution 3 is the most straightforward fix, so this is chosen here.Edit: Changed to solution 1 since dropping support for older distros like Ubuntu 20.04 is undesirable. It's also more flexible considering that this situation already occurred with the transition to C++17.
Conclusion
OpenBoard will eventually have to move on to C++ 20. Support for that is mostly complete in GCC, but still considered experimental. Poppler already requires it to build starting with 24.05, which afaics is only packaged with Arch Linux at this stage. Naturally, this will change in the future.
Fixes #958
Suggestions and feedback are always welcome!
-- Vekhir