Merge pull request #1861 from Jarod42/CodeliteEmptySourceTree

Fix Codelite generation of empty source tree project.
This commit is contained in:
Samuel Surtees 2022-05-11 22:58:47 +10:00 committed by GitHub
commit 0c7dfa7912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -116,6 +116,11 @@
function m.files(prj)
local tr = project.getsourcetree(prj)
if #tr.children == 0 then
-- handle project without files
_p(1, '<VirtualDirectory Name="%s"/>', tr.name)
return
end
tree.traverse(tr, {
-- folders are handled at the internal nodes
onbranchenter = function(node, depth)

View File

@ -100,3 +100,11 @@
</GlobalSettings>
]]
end
function suite.OnProject_EmptySourceFiles()
prepare()
codelite.project.files(prj)
test.capture [[
<VirtualDirectory Name="MyProject"/>
]]
end