Premake: Add include guard to make sure dependencies do not include themselves in an infinite chain when two components depend on each other

This commit is contained in:
Jan
2020-02-07 02:46:24 +01:00
parent 55d5746650
commit f73c27a7dc
21 changed files with 245 additions and 125 deletions

View File

@ -19,6 +19,37 @@ function TestFolder()
return path.getrelative(os.getcwd(), _TestFolder)
end
-- Functions for including projects
References = {
includeList = {},
linkList = {}
}
function References:include(name)
result = self.includeList[name] == nil
if result then
self.includeList[name] = true
end
return result
end
function References:link(name)
result = self.linkList[name] == nil
if result then
self.linkList[name] = true
end
return result
end
function References:reset()
self.includeList = {}
self.linkList = {}
end
-- Target Directories
TargetDirectoryBin = "%{wks.location}/bin/%{cfg.buildcfg}_%{cfg.platform}"
TargetDirectoryLib = "%{wks.location}/lib/%{cfg.buildcfg}_%{cfg.platform}"