Replies: 2 comments 5 replies
-
Thanks for this message! Always happy to get positive feedback. |
Beta Was this translation helpful? Give feedback.
0 replies
-
In general, agreeing that CMake setup is neat. Now the "but" :-) We struggle with one thing: setting global options. That's an anti-pattern in modern CMake. Typically things a target-based now. Case in point: # Play nicely if we are being consumed by another project
# and use their CMAKE_CXX_STANDARD. Otherwise, fall back to 17
# C++17 is used. We require fold expression at least.
if (DEFINED CMAKE_CXX_STANDARD)
set(CXX_STANDARD ${CMAKE_CXX_STANDARD})
else()
set(CXX_STANDARD 17)
endif() 👆 This requires us to use FTXUI like this: set(CMAKE_CXX_STANDARD 20)
add_subdirectory(aux/ftxui)
unset(CMAKE_CXX_STANDARD) Better: use # Require standard C++20.
target_compile_features(libvast_internal INTERFACE cxx_std_20) Then we could just write: add_subdirectory(aux/ftxui) and be on the happy path. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just wanted to throw in a "Thanks" here because usually when I encounter cmake files in a project, they throw so many errors that it's not even worth checking the logs.
Beta Was this translation helpful? Give feedback.
All reactions