mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-09 22:38:06 -05:00
Rework depedency management in premake lua scripts
This commit is contained in:
70
premake5.lua
70
premake5.lua
@ -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
|
||||
|
Reference in New Issue
Block a user