Replies: 1 comment 5 replies
-
https://github.com/xmake-io/xmake/blob/master/tests/projects/other/autogen_codedep/xmake.lua |
Beta Was this translation helpful? Give feedback.
5 replies
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.
-
比如有个外部工具,通过一些文件,在 temp 目录下生成一些 C++ 代码
生成逻辑比较复杂,源文件和 C++ 代码没有简单的一一对应关系,所以也比较难定义 xmake 的 rule 来生成
现在希望通过 xmake 在编译时,自动先调用代码生成工具,再把 temp 目录下的代码加入到 项目中
如
但这样 add_files 似乎找不到生成的 cpp 文件。
如果把生成代码的调用放到 on_load 执行,然后在 after_load 里去调用 target:add("fle", "temp/**.cpp")
似乎能解决问题,但依赖的 target 多了也有点麻烦,并且运行 xmake 的其它命令,如 run 等,也会出发 on_load 重新生成代码。
正确的姿势应该是什么?
Beta Was this translation helpful? Give feedback.
All reactions