Merged
Conversation
…tion to apps consistently
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.
I investigated this more and discovered that CMake's
export()command doesn't propagateINTERFACE_CXX_STANDARDor related properties to consuming applications. The solution appears to be capturing Cinder's C++ standard and extensions settings incinderConfig.cmakeand explicitly applying them to all applications viaci_make_app(). You'll note that the implementation uses a priority chain: user's explicitCMAKE_CXX_STANDARDoverride > Cinder's standard > default C++17. Extensions default to OFF (preventing the "namespace linux" issue) unless explicitly enabled withCMAKE_CXX_EXTENSIONS=ON.Part of what this PR changes is that overriding the C++ standard - including specifying
gnu++, should work now, and Cinder can actually build despite thelinuxdefinition with an additional flag.These are the combinations I tested:
cmake ..cmake ..-std=c++17cmake .. -DCMAKE_CXX_STANDARD=20cmake ..-std=c++20cmake .. -DCMAKE_CXX_STANDARD=23cmake ..-std=c++23cmake ..cmake .. -DCMAKE_CXX_STANDARD=20-std=c++17, App-std=c++20cmake .. -DCMAKE_CXX_STANDARD=20cmake .. -DCMAKE_CXX_STANDARD=23-std=c++20, App-std=c++23cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_CXX_FLAGS="-Ulinux"cmake .. -DCMAKE_CXX_FLAGS="-Ulinux"-std=gnu++17with-Ulinuxcmake .. -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_CXX_FLAGS="-Ulinux"cmake .. -DCMAKE_CXX_FLAGS="-Ulinux"-std=gnu++20with-Ulinuxcmake ..cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_CXX_FLAGS="-Ulinux"-std=c++17, App-std=gnu++17with-Ulinuxcmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_CXX_FLAGS="-Ulinux"cmake .. -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=OFF-std=gnu++17with-Ulinux, App-std=c++20cmake ..cmake .. -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=ON -DCMAKE_CXX_FLAGS="-Ulinux"-std=c++17, App-std=gnu++20with-Ulinuxcmake .. -DCMAKE_CXX_STANDARD=14cmake .. -DCMAKE_CXX_STANDARD=11As a bonus this includes a small fix to build with C++20. Hoping this addresses @PetrosKataras' issue seen against #2361