-
我用add_filegroups给vs工程里面的文件分组,但是好像无法达到想要的效果,我的目录结构是: --project | --- include | | | --- lib | | | ---common | | | --- *.h --- src | | | --- lib | | | --- common | | | --- *.cpp / *.h | --- xmake.lua xmake.lua 内容如下: target("common")
set_kind("static")
add_files("**.cpp")
add_headerfiles("**.h")
add_headerfiles("../../../include/lib/common/**.h")
add_filegroups("include", { rootdir="../../../include/lib/common/", files={"**.h"}}) 最终用vsxmake生成的工程中,仍然有..的目录: project | --- .. | | | ... include 我看了一下vsxmake的lua代码,觉得是因为这句导致的: 这里fileitem是相对于rootdir的相对目录,而filepattern是绝对路径,match就不会成功,我改成filepath:match就正常了。 另外,其实我想连include这个都不要,直接合并两个目录, if filepath:match(filepattern) then
if mode == "plain" then
filter = path.normalize(filegroup)
else
-- file tree mode (default)
if filegroup == "" then
filter = path.normalize(path.directory(fileitem))
else
filter = path.normalize(path.join(filegroup, path.directory(fileitem)))
end
end
if filter and filter == '.' then
filter = nil
end
return filter -- 已经找到了需要的filter,即使是nil也不应该break,否则没法合并根目录的文件
end |
Beta Was this translation helpful? Give feedback.
Answered by
waruqi
May 31, 2022
Replies: 1 comment 2 replies
-
你这个是 vsxmake generator 不是 vs generator。。 vs 工程之前改动后,相关 patch 同步到 vsxmake ,这个地方漏了一处同步,我刚更新了,再试下 dev |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Domain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你这个是 vsxmake generator 不是 vs generator。。
vs 工程之前改动后,相关 patch 同步到 vsxmake ,这个地方漏了一处同步,我刚更新了,再试下 dev