如何运行内置宏获取msvc版本? #3782
Unanswered
WilliamMiaoC
asked this question in
Q&A
Replies: 2 comments 1 reply
-
target:toolchain("msvc"):config("vs") |
Beta Was this translation helpful? Give feedback.
0 replies
-
如果获取mingw工具链的版本,能不能用 用 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我现在想实现对某一个编译器的最低要求版本的判断。系统里有vs2019和vs2022。
要求最低支持vs2019,所以在全局切换到vs2019之后,在rules获取
local vs = import("core.tool.toolchain").load("msvc"):config("vs")
输出的还是2022
我了解到,msvc提供了_MSC_VER内置宏,请问怎么在xmake里去获取该值呢?
clang、gcc,倒是可以使用
find_tool("clang", {version = true})
去获取判断,我执行
find_tool("link", {version = true})
没有任何效果类似cmake里的去限制MSVC最低版本
谢谢🙏
Beta Was this translation helpful? Give feedback.
All reactions