Rework depedency management in premake lua scripts

This commit is contained in:
Jan
2021-03-03 11:55:37 -08:00
parent 1a45cf2107
commit dc3fef5b0f
29 changed files with 447 additions and 386 deletions

View File

@ -1,68 +1,8 @@
-- Functions for locating commonly used folders
local _BuildFolder = path.getabsolute("build")
function BuildFolder()
return path.getrelative(os.getcwd(), _BuildFolder)
end
local _ThirdPartyFolder = path.getabsolute("thirdparty")
function ThirdPartyFolder()
return path.getrelative(os.getcwd(), _ThirdPartyFolder)
end
local _ProjectFolder = path.getabsolute("src")
function ProjectFolder()
return path.getrelative(os.getcwd(), _ProjectFolder)
end
local _TestFolder = path.getabsolute("test")
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}"
TargetDirectoryTest = "%{wks.location}/lib/%{cfg.buildcfg}_%{cfg.platform}/tests"
-- Platform functions
function ExecutableByOs(name)
if os.host() == "windows" then
return name .. ".exe"
else
return name
end
end
include "tools/scripts/folders.lua"
include "tools/scripts/including.lua"
include "tools/scripts/linking.lua"
include "tools/scripts/options.lua"
include "tools/scripts/platform.lua"
-- ==================
-- Workspace