-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xmake的获取变量 #15
Comments
targetdir 在 2.1.9 开发版本是有提供的: target("xxxx")
after_build(function (target)
print(target:targetdir())
end) 如果2.1.8等之前的版本可以这样获取: target("xxxx")
after_build(function (target)
print(path.directory(target:targetfile()))
end) targetname也是有的 依赖文件,可以通过以下方式获取: target("test")
after_build(function (target)
for _, incdepfile in ipairs(target:incdepfiles()) do
print(incdepfile) -- 这个只是打印每个依赖文件的路径,你可以先看下里面的内容,然后用io接口进行读取
local deps = io.load(incdepfile)
print(deps)
end
end) 另外xmake相关问题,尽量提到xmake/issues里面去,谢谢 |
地址没错,部分接口我漏写了,不好意思,这块我之后更新下文档,你先看下上面的接口使用例子好了,如果现在就需要更完整target接口,可以先去源码里面看:target.lua |
嗯哼,好的作者大大加油 emoji.嘿哈 |
其实这部分target接口,文档里面已经写了的,在project.target 你截图的那部分接口是 target("xxx")
set_kind("static") 而自定义脚本 on_run(function (target)
print(target:name())
print(target:targetfile())
end) |
希望可以获取targetdir,targetname,dependfile这样的变量内容
The text was updated successfully, but these errors were encountered: