我们可以使用 import() 导入自定义模块(Lua 脚本),以便在项目中共享逻辑。
add_rules("mode.debug", "mode.release")
add_moduledirs("xmake")
target("test")
set_kind("binary")
add_files("src/main.cpp")
on_load(function (target)
import("modules.hello").say("xmake")
end)
$ xmake
$ xmake run