Fix Codelite generation of empty source tree project.

This commit is contained in:
Jarod42 2022-04-15 00:36:27 +02:00 committed by Nick Clark
parent 190ee8bbf3
commit e83a9046c1
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