Replies: 2 comments 2 replies
-
This might require specific implementation on the code side to take advantage of it, but for the build side it can be something like: # Check C++ standard support
if (cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(default_cxx_std 17)
else ()
set(default_cxx_std 11)
endif ()
# Expose C++ standard to the user to overwrite
set(JSON_VALIDATOR_CXX_STD ${default_cxx_std} CACHE STRING "JsonValidator: C++ standard to use")
...
# Important to be local variable and not a cashe
set(CMAKE_CXX_STANDARD ${JSON_VALIDATOR_CXX_STD}) |
Beta Was this translation helpful? Give feedback.
0 replies
-
In that case, if the cxx standard could be overwritten or set to something below c++17 then the includes would not be found and the project would not compile. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was wondering if it would be a good idea to enable c++17 features -> set required version in cmake to c++17?
The reason is that the path file system handling would be much easier, since I had some problems getting the relative path to work in Windows for relative references ($ref) .
If that is an option, I could try to do a pull request.
Thanks for feedback.
Jan
Beta Was this translation helpful? Give feedback.
All reactions