-
For example: I have to target A and B. And I want to define a function that will be used in the Now, I just create a file import("xmake_modules.global")
global.my_functions(target) This way really works for me. I just want to know if this is a good way to implement so-called "global function&variables" in the script scope of xmake.lua. Thanks! In #3926 , I found something very useful. But I think the background of #3926 is about to define variables. So the first and second way in #3926 (comment) is not properate for a function definition. The third way in #3926 (comment) is just my way (use a new script file). No matter what, I believe my issue has been resolved in #3926. However, I think bringing up this problem would be helpful for future users conducting searches. Therefore, I still intend to post this question. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
you can define function in a single file. or use main entry. after_install("xmake_modules.global") ./xmake_modules/global.lua function main()
end you can also use add_moduledirs("xmake_modules")
target("test")
after_install("global") |
Beta Was this translation helpful? Give feedback.
you can define function in a single file.
or use main entry.
./xmake_modules/global.lua
you can also use
add_moduledirs
to add modules root directory.