[Cmake] allow disabling the c++11 constraint in check_support#321
[Cmake] allow disabling the c++11 constraint in check_support#321jeremy-rifkin merged 3 commits intojeremy-rifkin:mainfrom
Conversation
|
gotta love github CI 😅 |
|
All good! Github ci has been a bit flakey lately |
|
I just noticed that there is no |
|
One thought before merging this: CPPTRACE_INHERIT_HOST_PROPERTIES is a pretty broad name and it’s only used for the standard version. Might it be better to just have a CPPTRACE_MINIMUM_STANDARD version that defaults to C++11? The reason for setting the standard in check_support is just to get the minimum version set to at least C++11 for any old compilers that don’t default to C++11. For supporting adaptivecpp / sycl we’d just want to set it to at least C++17 it sounds like. Another approach could be to check if the standard is already set and if it’s set to >=11 not overwrite it. Thoughts? |
That could work. set(CMAKE_CXX_STANDARD ${CPPTRACE_MINIMUM_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Like this ? if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)That would work, i just don't know if there are side effect from doing this as this won't be a NFC anymore. My original reasoning was that cpptrace may want to inherit the # Inherit existing CMAKE_CXX_STANDARD automatically
if(NOT CPPTRACE_INHERIT_HOST_PROPERTIES)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
endif()What would you prefer ? |
|
Thanks for the reply! I think making this a no-functional change is a good goal. I'd say either the |
|
I went with the renaming to |
jeremy-rifkin
left a comment
There was a problem hiding this comment.
Looks good to me, thanks so much!
Implement the fix proposed in #320