如何给 target 应用多个 rule #3282
Answered
by
waruqi
star-hengxing
asked this question in
Q&A
如何给 target 应用多个 rule
#3282
-
这里想把二进制文件 codegen 到 cpp 文件和头文件,然后编译成静态库或动态库
现在我在第二个规则添加 -- rule2
add_deps("rule1", {order = true})
on_build_files(function (target, sourcebatch, opt)
print("on_build_files")
end)
我看文档是这样写 -- rule2
on_load(function (target)
local rule = target:rule("c++.build"):clone()
rule:add("deps", "bin2lib.build", {order = true})
target:rule_add(rule)
end) 但运行的时候输出了
|
Beta Was this translation helpful? Give feedback.
Answered by
waruqi
Jan 12, 2023
Replies: 1 comment 7 replies
-
参考现有 rule |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
star-hengxing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考现有 rule
https://github.com/xmake-io/xmake/blob/master/xmake/rules/lex_yacc/lex/xmake.lua