-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable c++20 #173
enable c++20 #173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for @RReichert approval before merging plz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the code works, I question if this is the best way forward. I would recommend something like this:
function(check_libcpp success)
check_cxx_source_compiles("
#include <iostream>
int a =
#ifdef _LIBCPP_VERSION
1;
#else
kdfasfdl
#endif
int main() {
return 0;
}
" ${success})
endfunction()
Where the function returns the true/false results. Its the responsibility of the caller to than add the definition to the compiler via target_compile_definitions
. Using -D
command line option is compiler specific way to add definitions, other compilers might not follow that approach (even though everything we support currently does).
I'd imagine that these checks would be used by one of the swift_add_*
target functions to add the definitions to the source files, as PUBLIC
definitions.
|
That was mostly for readability -
I agree with your overall point. It's not a good API - we're writing it to a specific implementation issue instead of providing an interface for the caller. I've updated the functions to just be pass/fail and then the caller can figure out what to do with the result. |
Automated PR by Jenkins. If CI has passed successfully, merge away! **cmake** f5113f7d -> 117b3f73 - 117b3f73 : enable c++20 (swift-nav/cmake#173) - 436d339a : Handle new suitesparse version (swift-nav/cmake#171) This pull request was created by https://jenkins.ci.swift-nav.com/job/CI%20Infra/job/submodule-update/17095/. Co-authored-by: Matt Woodward <[email protected]>
…485) Automated PR by Jenkins. If CI has passed successfully, merge away! **cmake** 436d339a -> 68306be8 - 68306be8 : ASIO gRPC boost container fix (swift-nav/cmake#174) - 117b3f73 : enable c++20 (swift-nav/cmake#173) This pull request was created by https://jenkins.ci.swift-nav.com/job/CI%20Infra/job/submodule-update/17362/.
Adds a couple of functions that are essentially necessary to enable using libc++ and clang-15 with C++20
I tested locally on mac with clang-15 and libc++