From af32c55db8e799002fe84d769c9b1a34f3040360 Mon Sep 17 00:00:00 2001 From: defiantnerd <97224712+defiantnerd@users.noreply.github.com> Date: Mon, 14 Sep 2026 08:30:05 +0200 Subject: [PATCH] Carry the C++17 requirement on the wrapper targets 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. --- cmake/shared_prologue.cmake | 11 +++++++++++ docs/ios.md | 1 + 2 files changed, 12 insertions(+) diff --git a/cmake/shared_prologue.cmake b/cmake/shared_prologue.cmake index 5c46c9cf..2265af77 100644 --- a/cmake/shared_prologue.cmake +++ b/cmake/shared_prologue.cmake @@ -94,6 +94,17 @@ add_library(clap-wrapper-compile-options INTERFACE) add_library(clap-wrapper-compile-options-public INTERFACE) target_link_libraries(clap-wrapper-compile-options INTERFACE clap-wrapper-compile-options-public) +# The wrapper sources need C++17 - std::filesystem, if-initializers - and carry that requirement +# themselves rather than leaving it to whoever is building them. The top-level CMakeLists sets +# CMAKE_CXX_STANDARD, but only when it *is* the top level, so a project that reaches the wrapper +# through add_subdirectory got no floor at all and failed in clap_proxy.cpp and +# preset_discovery.cpp against a generator default older than 17 - Xcode's, for one, which is how +# this surfaced while following docs/ios.md. +# +# 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 configuration this project supported. +target_compile_features(clap-wrapper-compile-options-public INTERFACE cxx_std_17) + # This is useful for debugging cmake link problems2 # target_compile_definitions(clap-wrapper-compile-options INTERFACE -DTHIS_BUILD_USED_CLAP_WRAPPER_COMPILE_OPTIONS=1) # target_compile_definitions(clap-wrapper-compile-options-public INTERFACE -DTHIS_BUILD_USED_CLAP_WRAPPER_COMPILE_OPTIONS_PUBLIC=1) diff --git a/docs/ios.md b/docs/ios.md index 733ae39e..4bad4c8f 100644 --- a/docs/ios.md +++ b/docs/ios.md @@ -254,6 +254,7 @@ still installed and still works normally in external hosts. | Host shows "Factory class ... is not linked" | Host target missing the entry source / impl library, or AU codes differ between host and appex | | Plugin appears on iPhone but not on iPad | Device family mismatch; both bundles must be `1,2` | | GUI stays empty | Plugin does not implement the `CLAP_WINDOW_API_UIKIT` window API | +| Errors in `clap_proxy.cpp` or `preset_discovery.cpp` about `std::filesystem` or `if` initializers | The project is building below C++17. The wrapper now carries a `cxx_std_17` floor, so this only appears against older wrapper versions; set `CMAKE_CXX_STANDARD` to 17 or higher in your own project | ## Current limitations