-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
C++20 features detection #1528
Comments
特性探测,我看没多少人用,所以一直没咋更新,如果你有兴趣,也可以帮忙改进下,其实也是从 cmake 那边 port 过来的。。 |
https://en.cppreference.com/w/cpp/feature_test 似乎c++20之后直接用check_macro就能完成这个检查了 |
那倒是省事了不少,就先用 check_macro 吧。。而且我看 cmake 的 cxxfeatures 也停留在 c++14 常年不更新了,感觉用的人不是很多。 |
不过既然有现成的命名和宏,后面有时间放到 check_features 里面也是可以的,也就是个体力活。。毕竟 check_feature 只需要调用一遍编译器,check_macros 每次都要执行一遍。效率上来讲,check_feature 会快不少 |
不对,都有现成宏了。。直接用不就完事了,为啥还要 check_macro 一遍再去定义个 HAS_XXX 宏。。这不有点多此一举么 = = |
编译成库的时候就确定好符号,这样之后换高版本的编译器也能链接,头文件不随编译器变化 |
c++17/20 的 我搞进去了。。 xmake/tests/apis/check_xxx/xmake.lua Lines 45 to 93 in de3e0ce
|
你在什么场景下需要该功能?
https://xmake.io/#/manual/extension_modules?id=compilerfeatures
现有的features detection缺少C++20的concepts、text format、modules等
描述可能的解决方案
添加c++20的features detection
The text was updated successfully, but these errors were encountered: