请问如何在function或rule里设置目标的平台? How set platform of target in function/rule? #4702
Unanswered
traversebitree
asked this question in
Q&A
Replies: 1 comment 1 reply
-
before_build 换成 on_load/on_config 试试,这些 config 应该在这些阶段才能配置 |
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.
-
由于
Zig c++
对MSVC的支持很有问题,我想写一个rule,判断当某个目标使用zig
作为工具链时,且目标平台为Windows,不要使用xx-windows-msvc
,而是强制使用xx-windows-gnu
。其他不采用zig
作为工具链的目标不受影响,还采用默认的工具链来编译。我只会在function里判断目标的工具链的平台是什么,请问如何在function里设置或修改平台呢?
以下为示例程序,在function里使用
target:set_plat("mingw")
命令会报错误"error: field 'set_plat' is not callable (a nil value)"。试了
target:set("plat","mingw")
也不行,虽然不报错,但也没起作用Beta Was this translation helpful? Give feedback.
All reactions