Replies: 2 comments 13 replies
-
on_load(function (target)
if target:has_tool("cxx", "cl", "clang_cl") then
target:set("languages", "c++latest")
elseif target:has_tool("cxx", "clang") then
target:add("cxxflags", "-fmodules-ts", "-Wc++20-extensions")
end
end) |
Beta Was this translation helpful? Give feedback.
12 replies
Answer selected by
Latias94
-
上面那个修复之前可以试试
|
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
如何拿到编译时 xmake 用的编译器和链接器名字(自动找到的编译器或者主动
set_toolchains
设置的等等),这样可以根据不同编译器设置不同的 flag。类似于 CMake 这种逻辑:
is_config
貌似要主动设置了 (xmake f --toolchain=msvc
) 才能拿到值。尝试了在描述域里面 set_toolchains,下面的逻辑里面也获取不到配置,逻辑走不到。除非
xmake f --toolchain
主动配置工具链。有没有办法不需要设置也能拿到当前用的编译器或链接器的信息?
Beta Was this translation helpful? Give feedback.
All reactions