Carry the C++17 requirement on the wrapper targets - #557
Merged
Merged
Conversation
The wrapper sources need C++17 - std::filesystem, if-initializers - but only the top-level CMakeLists set CMAKE_CXX_STANDARD, and it did so inside an if (PROJECT_IS_TOP_LEVEL) guard. A project consuming the wrapper through add_subdirectory therefore got no floor at all and compiled against whatever its generator defaulted to, failing in clap_proxy.cpp and preset_discovery.cpp. Xcode is one such generator, which is how this surfaces for anyone following docs/ios.md to build an iOS AUv3 - the first configure dies before anything wrapper-specific is reached. Put the requirement where the requirement is, as a compile feature on clap-wrapper-compile-options-public, so it reaches every consumer of those targets without anyone having to know about it. A floor rather than a pin: a consumer building at 20 stays at 20 - verified that the C++20 configuration still selects stdcpp20 and keeps /Zc:char8_t-. It only raises a build that was below 17, which was never a supported configuration. The ios.md troubleshooting table gains the symptom, since an older wrapper in someone's tree will still show it.
baconpaul
approved these changes
Sep 14, 2026
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.
Independent of the 0.16 review PRs. Found while validating #548 on iOS.
The problem
The wrapper sources need C++17 —
std::filesystem,ifinitializers — but the only place that says so isCMakeLists.txt:112, insideif (PROJECT_IS_TOP_LEVEL).A project consuming the wrapper through
add_subdirectorytherefore gets no floor at all and compiles against whatever its generator defaults to. Xcode is one such generator, so anyone followingdocs/ios.mdto build an iOS AUv3 hits it: the configure dies inclap_proxy.cppandpreset_discovery.cppbefore anything wrapper-specific is reached. That is the first thing the doc tells you to do, and it does not work as written.The fix
Put the requirement where the requirement is — a
cxx_std_17compile feature onclap-wrapper-compile-options-public, so it reaches every consumer of those targets without anyone needing to know about it.It is a floor, not a pin. A consumer building at 20 stays at 20; it only raises a build that was below 17, which was never a supported configuration. Verified: with
-DCLAP_WRAPPER_CXX_STANDARD=20the generated project still selectsstdcpp20and still applies/Zc:char8_t-, so nothing about the C++20 path changes.docs/ios.mdgains the symptom in its troubleshooting table, since an older wrapper checked out in someone's tree will still show it.Verification
stdcpp20and/Zc:char8_t-, i.e. the floor does not clamp.The consuming-project case this actually fixes is an iOS
add_subdirectorybuild, which is worth a confirmation on a Mac — a fresh project followingdocs/ios.mdthat does not setCMAKE_CXX_STANDARDshould now configure and build.Note
Also worth considering separately:
docs/ios.mdhas no test target in the repo, so nothing exercises the documented path in CI. This class of bug only shows up when someone follows the doc by hand.