mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Rework depedency management in premake lua scripts
This commit is contained in:
parent
1a45cf2107
commit
dc3fef5b0f
70
premake5.lua
70
premake5.lua
@ -1,68 +1,8 @@
|
|||||||
-- Functions for locating commonly used folders
|
include "tools/scripts/folders.lua"
|
||||||
local _BuildFolder = path.getabsolute("build")
|
include "tools/scripts/including.lua"
|
||||||
function BuildFolder()
|
include "tools/scripts/linking.lua"
|
||||||
return path.getrelative(os.getcwd(), _BuildFolder)
|
include "tools/scripts/options.lua"
|
||||||
end
|
include "tools/scripts/platform.lua"
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
-- ==================
|
-- ==================
|
||||||
-- Workspace
|
-- Workspace
|
||||||
|
@ -1,31 +1,33 @@
|
|||||||
Crypto = {}
|
Crypto = {}
|
||||||
|
|
||||||
function Crypto:include()
|
function Crypto:include(includes)
|
||||||
if References:include("Crypto") then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "Crypto")
|
path.join(ProjectFolder(), "Crypto")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Crypto:link()
|
function Crypto:link(links)
|
||||||
if References:link("Crypto") then
|
links:add(self:name())
|
||||||
libtomcrypt:link()
|
links:linkto(libtomcrypt)
|
||||||
libtommath:link()
|
links:linkto(libtommath)
|
||||||
salsa20:link()
|
links:linkto(salsa20)
|
||||||
links "Crypto"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Crypto:use()
|
function Crypto:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Crypto:project()
|
function Crypto:name()
|
||||||
References:reset()
|
return "Crypto"
|
||||||
local folder = ProjectFolder();
|
end
|
||||||
|
|
||||||
project "Crypto"
|
function Crypto:project()
|
||||||
|
local folder = ProjectFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -36,8 +38,8 @@ function Crypto:project()
|
|||||||
path.join(folder, "Crypto/**.cpp")
|
path.join(folder, "Crypto/**.cpp")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
libtomcrypt:include()
|
libtomcrypt:include(includes)
|
||||||
libtommath:include()
|
libtommath:include(includes)
|
||||||
salsa20:include()
|
salsa20:include(includes)
|
||||||
end
|
end
|
||||||
|
@ -1,26 +1,31 @@
|
|||||||
Linker = {}
|
Linker = {}
|
||||||
|
|
||||||
function Linker:include()
|
function Linker:include(includes)
|
||||||
if References:include("Linker") then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "Linker")
|
path.join(ProjectFolder(), "Linker")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Linker:link()
|
function Linker:link(links)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Linker:use()
|
function Linker:use()
|
||||||
dependson "Linker"
|
dependson(self:name())
|
||||||
|
end
|
||||||
|
|
||||||
|
function Linker:name()
|
||||||
|
return "Linker"
|
||||||
end
|
end
|
||||||
|
|
||||||
function Linker:project()
|
function Linker:project()
|
||||||
References:reset()
|
local folder = ProjectFolder()
|
||||||
local folder = ProjectFolder();
|
local includes = Includes:create()
|
||||||
|
local links = Links:create()
|
||||||
|
|
||||||
project "Linker"
|
project(self:name())
|
||||||
targetdir(TargetDirectoryBin)
|
targetdir(TargetDirectoryBin)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "ConsoleApp"
|
kind "ConsoleApp"
|
||||||
@ -31,10 +36,12 @@ function Linker:project()
|
|||||||
path.join(folder, "Linker/**.cpp")
|
path.join(folder, "Linker/**.cpp")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
ZoneWriting:include()
|
ZoneWriting:include(includes)
|
||||||
|
|
||||||
Utils:link()
|
links:linkto(Utils)
|
||||||
--ZoneWriting:link()
|
links:linkto(ZoneWriting)
|
||||||
|
--ZoneWriting:link(links)
|
||||||
|
links:linkall()
|
||||||
end
|
end
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
ObjCommon = {}
|
ObjCommon = {}
|
||||||
|
|
||||||
function ObjCommon:include()
|
function ObjCommon:include(includes)
|
||||||
if References:include("ObjCommon") then
|
if includes:handle(self:name()) then
|
||||||
ZoneCommon:include()
|
ZoneCommon:include(includes)
|
||||||
minizip:include()
|
minizip:include(includes)
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ObjCommon")
|
path.join(ProjectFolder(), "ObjCommon")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjCommon:link()
|
function ObjCommon:link(links)
|
||||||
if References:link("ObjCommon") then
|
links:add(self:name())
|
||||||
Utils:link()
|
links:linkto(Utils)
|
||||||
ZoneCommon:link()
|
links:linkto(ZoneCommon)
|
||||||
minizip:link()
|
links:linkto(minizip)
|
||||||
links {
|
|
||||||
"ObjCommon"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjCommon:use()
|
function ObjCommon:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjCommon:project()
|
function ObjCommon:name()
|
||||||
References:reset()
|
return "ObjCommon"
|
||||||
local folder = ProjectFolder();
|
end
|
||||||
|
|
||||||
project "ObjCommon"
|
function ObjCommon:project()
|
||||||
|
local folder = ProjectFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -46,6 +46,6 @@ function ObjCommon:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
end
|
end
|
||||||
|
@ -1,38 +1,38 @@
|
|||||||
ObjLoading = {}
|
ObjLoading = {}
|
||||||
|
|
||||||
function ObjLoading:include()
|
function ObjLoading:include(includes)
|
||||||
if References:include("ObjLoading") then
|
if includes:handle(self:name()) then
|
||||||
ObjCommon:include()
|
ObjCommon:include(includes)
|
||||||
ZoneCommon:include()
|
ZoneCommon:include(includes)
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ObjLoading")
|
path.join(ProjectFolder(), "ObjLoading")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjLoading:link()
|
function ObjLoading:link(links)
|
||||||
if References:link("ObjLoading") then
|
links:add(self:name())
|
||||||
Utils:link()
|
links:linkto(Utils)
|
||||||
ObjCommon:link()
|
links:linkto(ObjCommon)
|
||||||
ZoneCommon:link()
|
links:linkto(ZoneCommon)
|
||||||
minilzo:link()
|
links:linkto(minilzo)
|
||||||
minizip:link()
|
links:linkto(minizip)
|
||||||
zlib:link()
|
links:linkto(zlib)
|
||||||
links {
|
|
||||||
"ObjLoading"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjLoading:use()
|
function ObjLoading:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjLoading:project()
|
function ObjLoading:name()
|
||||||
References:reset()
|
return "ObjLoading"
|
||||||
local folder = ProjectFolder();
|
end
|
||||||
|
|
||||||
project "ObjLoading"
|
function ObjLoading:project()
|
||||||
|
local folder = ProjectFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -49,10 +49,10 @@ function ObjLoading:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
Crypto:include()
|
Crypto:include(includes)
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
minilzo:include()
|
minilzo:include(includes)
|
||||||
minizip:include()
|
minizip:include(includes)
|
||||||
zlib:include()
|
zlib:include(includes)
|
||||||
end
|
end
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
ObjWriting = {}
|
ObjWriting = {}
|
||||||
|
|
||||||
function ObjWriting:include()
|
function ObjWriting:include(includes)
|
||||||
if References:include("ObjWriting") then
|
if includes:handle(self:name()) then
|
||||||
ObjCommon:include()
|
ObjCommon:include(includes)
|
||||||
ZoneCommon:include()
|
ZoneCommon:include(includes)
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ObjWriting")
|
path.join(ProjectFolder(), "ObjWriting")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjWriting:link()
|
function ObjWriting:link(links)
|
||||||
if References:link("ObjWriting") then
|
links:add(self:name())
|
||||||
Utils:link()
|
links:linkto(Utils)
|
||||||
ObjCommon:link()
|
links:linkto(ObjCommon)
|
||||||
ZoneCommon:link()
|
links:linkto(ZoneCommon)
|
||||||
minilzo:link()
|
links:linkto(minilzo)
|
||||||
minizip:link()
|
links:linkto(minizip)
|
||||||
links {
|
|
||||||
"ObjWriting"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjWriting:use()
|
function ObjWriting:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjWriting:project()
|
function ObjWriting:name()
|
||||||
References:reset()
|
return "ObjWriting"
|
||||||
local folder = ProjectFolder();
|
end
|
||||||
|
|
||||||
project "ObjWriting"
|
function ObjWriting:project()
|
||||||
|
local folder = ProjectFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -48,8 +48,8 @@ function ObjWriting:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
minilzo:include()
|
minilzo:include(includes)
|
||||||
minizip:include()
|
minizip:include(includes)
|
||||||
end
|
end
|
||||||
|
@ -1,26 +1,31 @@
|
|||||||
Unlinker = {}
|
Unlinker = {}
|
||||||
|
|
||||||
function Unlinker:include()
|
function Unlinker:include(includes)
|
||||||
if References:include("Unlinker") then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "Unlinker")
|
path.join(ProjectFolder(), "Unlinker")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Unlinker:link()
|
function Unlinker:link(links)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Unlinker:use()
|
function Unlinker:use()
|
||||||
dependson "Unlinker"
|
dependson(self:name())
|
||||||
|
end
|
||||||
|
|
||||||
|
function Unlinker:name()
|
||||||
|
return "Unlinker"
|
||||||
end
|
end
|
||||||
|
|
||||||
function Unlinker:project()
|
function Unlinker:project()
|
||||||
References:reset()
|
local folder = ProjectFolder()
|
||||||
local folder = ProjectFolder();
|
local includes = Includes:create()
|
||||||
|
local links = Links:create()
|
||||||
|
|
||||||
project "Unlinker"
|
project(self:name())
|
||||||
targetdir(TargetDirectoryBin)
|
targetdir(TargetDirectoryBin)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "ConsoleApp"
|
kind "ConsoleApp"
|
||||||
@ -31,14 +36,15 @@ function Unlinker:project()
|
|||||||
path.join(folder, "Unlinker/**.cpp")
|
path.join(folder, "Unlinker/**.cpp")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
ZoneLoading:include()
|
ZoneLoading:include(includes)
|
||||||
ObjLoading:include()
|
ObjLoading:include(includes)
|
||||||
ObjWriting:include()
|
ObjWriting:include(includes)
|
||||||
|
|
||||||
Utils:link()
|
links:linkto(Utils)
|
||||||
ZoneLoading:link()
|
links:linkto(ZoneLoading)
|
||||||
ObjLoading:link()
|
links:linkto(ObjLoading)
|
||||||
ObjWriting:link()
|
links:linkto(ObjWriting)
|
||||||
|
links:linkall()
|
||||||
end
|
end
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
Utils = {}
|
Utils = {}
|
||||||
|
|
||||||
function Utils:include()
|
function Utils:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "Utils")
|
path.join(ProjectFolder(), "Utils")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Utils:link()
|
function Utils:link(links)
|
||||||
if References:link(self:name()) then
|
links:add(self:name())
|
||||||
links(self:name())
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Utils:use()
|
function Utils:use()
|
||||||
@ -23,8 +21,8 @@ function Utils:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Utils:project()
|
function Utils:project()
|
||||||
References:reset()
|
local folder = ProjectFolder()
|
||||||
local folder = ProjectFolder();
|
local includes = Includes:create()
|
||||||
|
|
||||||
project(self:name())
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
@ -43,5 +41,5 @@ function Utils:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
end
|
end
|
||||||
|
@ -145,8 +145,8 @@ function ZoneCode:allWriteFiles()
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCode:include()
|
function ZoneCode:include(includes)
|
||||||
if References:include("ZoneCode") then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ZoneCode"),
|
path.join(ProjectFolder(), "ZoneCode"),
|
||||||
"%{wks.location}/src/ZoneCode"
|
"%{wks.location}/src/ZoneCode"
|
||||||
@ -154,19 +154,22 @@ function ZoneCode:include()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCode:link()
|
function ZoneCode:link(links)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCode:use()
|
function ZoneCode:use()
|
||||||
dependson "ZoneCode"
|
dependson(self:name())
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneCode:name()
|
||||||
|
return "ZoneCode"
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCode:project()
|
function ZoneCode:project()
|
||||||
References:reset()
|
local folder = ProjectFolder()
|
||||||
local folder = ProjectFolder();
|
|
||||||
|
|
||||||
project "ZoneCode"
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "Utility"
|
kind "Utility"
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
ZoneCodeGenerator = {}
|
ZoneCodeGenerator = {}
|
||||||
|
|
||||||
function ZoneCodeGenerator:include()
|
function ZoneCodeGenerator:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ZoneCodeGenerator")
|
path.join(ProjectFolder(), "ZoneCodeGenerator")
|
||||||
}
|
}
|
||||||
|
Utils:include(includes)
|
||||||
end
|
end
|
||||||
Utils:include()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGenerator:link()
|
function ZoneCodeGenerator:link(links)
|
||||||
if References:link(self:name()) then
|
|
||||||
links(self:name())
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGenerator:use()
|
function ZoneCodeGenerator:use()
|
||||||
@ -24,8 +22,9 @@ function ZoneCodeGenerator:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGenerator:project()
|
function ZoneCodeGenerator:project()
|
||||||
References:reset()
|
local folder = ProjectFolder()
|
||||||
local folder = ProjectFolder();
|
local includes = Includes:create()
|
||||||
|
local links = Links:create()
|
||||||
|
|
||||||
project(self:name())
|
project(self:name())
|
||||||
targetdir(TargetDirectoryBin)
|
targetdir(TargetDirectoryBin)
|
||||||
@ -43,9 +42,10 @@ function ZoneCodeGenerator:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
ZoneCodeGeneratorLib:include()
|
ZoneCodeGeneratorLib:include(includes)
|
||||||
|
|
||||||
ZoneCodeGeneratorLib:link()
|
links:linkto(Utils)
|
||||||
Utils:link()
|
links:linkto(ZoneCodeGeneratorLib)
|
||||||
|
links:linkall()
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
ZoneCodeGeneratorLib = {}
|
ZoneCodeGeneratorLib = {}
|
||||||
|
|
||||||
function ZoneCodeGeneratorLib:include()
|
function ZoneCodeGeneratorLib:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ZoneCodeGeneratorLib")
|
path.join(ProjectFolder(), "ZoneCodeGeneratorLib")
|
||||||
}
|
}
|
||||||
|
Utils:include(includes)
|
||||||
end
|
end
|
||||||
Utils:include()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGeneratorLib:link()
|
function ZoneCodeGeneratorLib:link(links)
|
||||||
if References:link(self:name()) then
|
links:add(self:name())
|
||||||
links(self:name())
|
links:linkto(Utils)
|
||||||
Utils:link()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGeneratorLib:use()
|
function ZoneCodeGeneratorLib:use()
|
||||||
@ -25,8 +23,8 @@ function ZoneCodeGeneratorLib:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGeneratorLib:project()
|
function ZoneCodeGeneratorLib:project()
|
||||||
References:reset()
|
local folder = ProjectFolder()
|
||||||
local folder = ProjectFolder();
|
local includes = Includes:create()
|
||||||
|
|
||||||
project(self:name())
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
@ -39,7 +37,5 @@ function ZoneCodeGeneratorLib:project()
|
|||||||
path.join(folder, "ZoneCodeGeneratorLib/**.cpp")
|
path.join(folder, "ZoneCodeGeneratorLib/**.cpp")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
|
|
||||||
Utils:link()
|
|
||||||
end
|
end
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
ZoneCommon = {}
|
ZoneCommon = {}
|
||||||
|
|
||||||
function ZoneCommon:include()
|
function ZoneCommon:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
ObjCommon:include()
|
ObjCommon:include(includes)
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ZoneCommon")
|
path.join(ProjectFolder(), "ZoneCommon")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCommon:link()
|
function ZoneCommon:link(links)
|
||||||
if References:link(self:name()) then
|
links:add(self:name())
|
||||||
links(self:name())
|
links:linkto(Utils)
|
||||||
Utils:link()
|
links:linkto(ObjCommon)
|
||||||
ObjCommon:link()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCommon:use()
|
function ZoneCommon:use()
|
||||||
@ -27,8 +25,8 @@ function ZoneCommon:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCommon:project()
|
function ZoneCommon:project()
|
||||||
References:reset()
|
local folder = ProjectFolder()
|
||||||
local folder = ProjectFolder();
|
local includes = Includes:create()
|
||||||
|
|
||||||
project(self:name())
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
@ -41,7 +39,5 @@ function ZoneCommon:project()
|
|||||||
path.join(folder, "ZoneCommon/**.cpp")
|
path.join(folder, "ZoneCommon/**.cpp")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
|
|
||||||
Utils:link()
|
|
||||||
end
|
end
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
ZoneLoading = {}
|
ZoneLoading = {}
|
||||||
|
|
||||||
function ZoneLoading:include()
|
function ZoneLoading:include(includes)
|
||||||
if References:include("ZoneLoading") then
|
if includes:handle(self:name()) then
|
||||||
ZoneCommon:include()
|
ZoneCommon:include(includes)
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ZoneLoading")
|
path.join(ProjectFolder(), "ZoneLoading")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneLoading:link()
|
function ZoneLoading:link(links)
|
||||||
if References:link("ZoneLoading") then
|
links:add(self:name())
|
||||||
Crypto:link()
|
links:linkto(Crypto)
|
||||||
Utils:link()
|
links:linkto(Utils)
|
||||||
ZoneCommon:link()
|
links:linkto(ZoneCommon)
|
||||||
zlib:link()
|
links:linkto(zlib)
|
||||||
links {
|
|
||||||
"ZoneLoading"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneLoading:use()
|
function ZoneLoading:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneLoading:project()
|
function ZoneLoading:name()
|
||||||
References:reset()
|
return "ZoneLoading"
|
||||||
local folder = ProjectFolder();
|
end
|
||||||
|
|
||||||
project "ZoneLoading"
|
function ZoneLoading:project()
|
||||||
|
local folder = ProjectFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -48,11 +48,11 @@ function ZoneLoading:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
Crypto:include()
|
Crypto:include(includes)
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
zlib:include()
|
zlib:include(includes)
|
||||||
ZoneCode:include()
|
ZoneCode:include(includes)
|
||||||
|
|
||||||
ZoneCode:use()
|
ZoneCode:use()
|
||||||
end
|
end
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
ZoneWriting = {}
|
ZoneWriting = {}
|
||||||
|
|
||||||
function ZoneWriting:include()
|
function ZoneWriting:include(includes)
|
||||||
if References:include("ZoneWriting") then
|
if includes:handle(self:name()) then
|
||||||
ZoneCommon:include()
|
ZoneCommon:include(includes)
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ProjectFolder(), "ZoneWriting")
|
path.join(ProjectFolder(), "ZoneWriting")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneWriting:link()
|
function ZoneWriting:link(links)
|
||||||
if References:link("ZoneWriting") then
|
links:add(self:name())
|
||||||
Crypto:link()
|
links:linkto(Crypto)
|
||||||
Utils:link()
|
links:linkto(Utils)
|
||||||
ZoneCommon:link()
|
links:linkto(ZoneCommon)
|
||||||
zlib:link()
|
links:linkto(zlib)
|
||||||
links {
|
|
||||||
"ZoneWriting"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneWriting:use()
|
function ZoneWriting:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneWriting:project()
|
function ZoneWriting:name()
|
||||||
References:reset()
|
return "ZoneWriting"
|
||||||
local folder = ProjectFolder();
|
end
|
||||||
|
|
||||||
project "ZoneWriting"
|
function ZoneWriting:project()
|
||||||
|
local folder = ProjectFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/src/%{prj.name}"
|
location "%{wks.location}/src/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -46,10 +46,10 @@ function ZoneWriting:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
Crypto:include()
|
Crypto:include(includes)
|
||||||
Utils:include()
|
Utils:include(includes)
|
||||||
zlib:include()
|
zlib:include(includes)
|
||||||
|
|
||||||
ZoneCode:use()
|
ZoneCode:use()
|
||||||
end
|
end
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
ObjCommonTests = {}
|
ObjCommonTests = {}
|
||||||
|
|
||||||
function ObjCommonTests:include()
|
function ObjCommonTests:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(TestFolder(), "ObjCommonTests")
|
path.join(TestFolder(), "ObjCommonTests")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjCommonTests:link()
|
function ObjCommonTests:link(links)
|
||||||
if References:link(self:name()) then
|
|
||||||
links(self:name())
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ObjCommonTests:use()
|
function ObjCommonTests:use()
|
||||||
@ -23,8 +21,9 @@ function ObjCommonTests:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ObjCommonTests:project()
|
function ObjCommonTests:project()
|
||||||
References:reset()
|
local folder = TestFolder()
|
||||||
local folder = TestFolder();
|
local includes = Includes:create()
|
||||||
|
local links = Links:create()
|
||||||
|
|
||||||
project(self:name())
|
project(self:name())
|
||||||
targetdir(TargetDirectoryTest)
|
targetdir(TargetDirectoryTest)
|
||||||
@ -44,9 +43,10 @@ function ObjCommonTests:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
ObjCommon:include()
|
ObjCommon:include(includes)
|
||||||
catch2:include()
|
catch2:include(includes)
|
||||||
|
|
||||||
ObjCommon:link()
|
links:linkto(ObjCommon)
|
||||||
|
links:linkall()
|
||||||
end
|
end
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
ZoneCodeGeneratorLibTests = {}
|
ZoneCodeGeneratorLibTests = {}
|
||||||
|
|
||||||
function ZoneCodeGeneratorLibTests:include()
|
function ZoneCodeGeneratorLibTests:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(TestFolder(), "ZoneCodeGeneratorLibTests")
|
path.join(TestFolder(), "ZoneCodeGeneratorLibTests")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGeneratorLibTests:link()
|
function ZoneCodeGeneratorLibTests:link(links)
|
||||||
if References:link(self:name()) then
|
|
||||||
links(self:name())
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGeneratorLibTests:use()
|
function ZoneCodeGeneratorLibTests:use()
|
||||||
@ -23,8 +21,9 @@ function ZoneCodeGeneratorLibTests:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCodeGeneratorLibTests:project()
|
function ZoneCodeGeneratorLibTests:project()
|
||||||
References:reset()
|
local folder = TestFolder()
|
||||||
local folder = TestFolder();
|
local includes = Includes:create()
|
||||||
|
local links = Links:create()
|
||||||
|
|
||||||
project(self:name())
|
project(self:name())
|
||||||
targetdir(TargetDirectoryTest)
|
targetdir(TargetDirectoryTest)
|
||||||
@ -43,9 +42,10 @@ function ZoneCodeGeneratorLibTests:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
ZoneCodeGeneratorLib:include()
|
ZoneCodeGeneratorLib:include(includes)
|
||||||
catch2:include()
|
catch2:include(includes)
|
||||||
|
|
||||||
ZoneCodeGeneratorLib:link()
|
links:linkto(ZoneCodeGeneratorLib)
|
||||||
|
links:linkall()
|
||||||
end
|
end
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
ZoneCommonTests = {}
|
ZoneCommonTests = {}
|
||||||
|
|
||||||
function ZoneCommonTests:include()
|
function ZoneCommonTests:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(TestFolder(), "ZoneCommonTests")
|
path.join(TestFolder(), "ZoneCommonTests")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCommonTests:link()
|
function ZoneCommonTests:link(links)
|
||||||
if References:link(self:name()) then
|
|
||||||
links(self:name())
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCommonTests:use()
|
function ZoneCommonTests:use()
|
||||||
@ -23,8 +21,9 @@ function ZoneCommonTests:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ZoneCommonTests:project()
|
function ZoneCommonTests:project()
|
||||||
References:reset()
|
local folder = TestFolder()
|
||||||
local folder = TestFolder();
|
local includes = Includes:create()
|
||||||
|
local links = Links:create()
|
||||||
|
|
||||||
project(self:name())
|
project(self:name())
|
||||||
targetdir(TargetDirectoryTest)
|
targetdir(TargetDirectoryTest)
|
||||||
@ -45,11 +44,12 @@ function ZoneCommonTests:project()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
ZoneCommon:include()
|
ZoneCommon:include(includes)
|
||||||
catch2:include()
|
catch2:include(includes)
|
||||||
|
|
||||||
ZoneCommon:link()
|
links:linkto(ZoneCommon)
|
||||||
|
links:linkall()
|
||||||
|
|
||||||
ZoneCode:use()
|
ZoneCode:use()
|
||||||
end
|
end
|
||||||
|
5
thirdparty/catch2.lua
vendored
5
thirdparty/catch2.lua
vendored
@ -1,7 +1,7 @@
|
|||||||
catch2 = {}
|
catch2 = {}
|
||||||
|
|
||||||
function catch2:include()
|
function catch2:include(includes)
|
||||||
if References:include(self:name()) then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ThirdPartyFolder(), "catch2", "single_include")
|
path.join(ThirdPartyFolder(), "catch2", "single_include")
|
||||||
}
|
}
|
||||||
@ -20,5 +20,4 @@ function catch2:name()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function catch2:project()
|
function catch2:project()
|
||||||
References:reset()
|
|
||||||
end
|
end
|
||||||
|
27
thirdparty/libtomcrypt.lua
vendored
27
thirdparty/libtomcrypt.lua
vendored
@ -1,7 +1,7 @@
|
|||||||
libtomcrypt = {}
|
libtomcrypt = {}
|
||||||
|
|
||||||
function libtomcrypt:include()
|
function libtomcrypt:include(includes)
|
||||||
if References:include("libtomcrypt") then
|
if includes:handle(self:name()) then
|
||||||
defines{
|
defines{
|
||||||
"LTM_DESC"
|
"LTM_DESC"
|
||||||
}
|
}
|
||||||
@ -12,21 +12,24 @@ function libtomcrypt:include()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function libtomcrypt:link()
|
function libtomcrypt:link(links)
|
||||||
if References:link("libtomcrypt") then
|
links:add(self:name())
|
||||||
links "libtomcrypt"
|
links:linkto(libtommath)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function libtomcrypt:use()
|
function libtomcrypt:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function libtomcrypt:project()
|
function libtomcrypt:name()
|
||||||
References:reset()
|
return "libtomcrypt"
|
||||||
local folder = ThirdPartyFolder();
|
end
|
||||||
|
|
||||||
project "libtomcrypt"
|
function libtomcrypt:project()
|
||||||
|
local folder = ThirdPartyFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -45,8 +48,8 @@ function libtomcrypt:project()
|
|||||||
"LTC_NO_PROTOTYPES"
|
"LTC_NO_PROTOTYPES"
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
libtommath:include()
|
libtommath:include(includes)
|
||||||
|
|
||||||
-- Disable warnings. They do not have any value to us since it is not our code.
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
warnings "off"
|
warnings "off"
|
||||||
|
24
thirdparty/libtommath.lua
vendored
24
thirdparty/libtommath.lua
vendored
@ -1,28 +1,30 @@
|
|||||||
libtommath = {}
|
libtommath = {}
|
||||||
|
|
||||||
function libtommath:include()
|
function libtommath:include(includes)
|
||||||
if References:include("libtommath") then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ThirdPartyFolder(), "libtommath")
|
path.join(ThirdPartyFolder(), "libtommath")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function libtommath:link()
|
function libtommath:link(links)
|
||||||
if References:link("libtommath") then
|
links:add(self:name())
|
||||||
links "libtommath"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function libtommath:use()
|
function libtommath:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function libtommath:project()
|
function libtommath:name()
|
||||||
References:reset()
|
return "libtommath"
|
||||||
local folder = ThirdPartyFolder();
|
end
|
||||||
|
|
||||||
project "libtommath"
|
function libtommath:project()
|
||||||
|
local folder = ThirdPartyFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -33,7 +35,7 @@ function libtommath:project()
|
|||||||
path.join(folder, "libtommath/*.c")
|
path.join(folder, "libtommath/*.c")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
|
|
||||||
-- Disable warnings. They do not have any value to us since it is not our code.
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
warnings "off"
|
warnings "off"
|
||||||
|
24
thirdparty/minilzo.lua
vendored
24
thirdparty/minilzo.lua
vendored
@ -1,28 +1,30 @@
|
|||||||
minilzo = {}
|
minilzo = {}
|
||||||
|
|
||||||
function minilzo:include()
|
function minilzo:include(includes)
|
||||||
if References:include("minilzo") then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ThirdPartyFolder(), "minilzo")
|
path.join(ThirdPartyFolder(), "minilzo")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function minilzo:link()
|
function minilzo:link(links)
|
||||||
if References:link("minilzo") then
|
links:add(self:name())
|
||||||
links "minilzo"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function minilzo:use()
|
function minilzo:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function minilzo:project()
|
function minilzo:name()
|
||||||
References:reset()
|
return "minilzo"
|
||||||
local folder = ThirdPartyFolder();
|
end
|
||||||
|
|
||||||
project "minilzo"
|
function minilzo:project()
|
||||||
|
local folder = ThirdPartyFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -33,7 +35,7 @@ function minilzo:project()
|
|||||||
path.join(folder, "minilzo/*.c")
|
path.join(folder, "minilzo/*.c")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
|
|
||||||
-- Disable warnings. They do not have any value to us since it is not our code.
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
warnings "off"
|
warnings "off"
|
||||||
|
28
thirdparty/minizip.lua
vendored
28
thirdparty/minizip.lua
vendored
@ -1,30 +1,32 @@
|
|||||||
minizip = {}
|
minizip = {}
|
||||||
|
|
||||||
function minizip:include()
|
function minizip:include(includes)
|
||||||
if References:include("minizip") then
|
if includes:handle(self:name()) then
|
||||||
zlib:include()
|
zlib:include(includes)
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ThirdPartyFolder(), "zlib/contrib/minizip")
|
path.join(ThirdPartyFolder(), "zlib/contrib/minizip")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function minizip:link()
|
function minizip:link(links)
|
||||||
if References:link("minizip") then
|
links:add(self:name())
|
||||||
zlib:link()
|
links:linkto(zlib)
|
||||||
links "minizip"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function minizip:use()
|
function minizip:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function minizip:project()
|
function minizip:name()
|
||||||
References:reset()
|
return "minizip"
|
||||||
local folder = ThirdPartyFolder();
|
end
|
||||||
|
|
||||||
project "minizip"
|
function minizip:project()
|
||||||
|
local folder = ThirdPartyFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -40,7 +42,7 @@ function minizip:project()
|
|||||||
path.join(folder, "zlib/contrib/minizip/crypt.h"),
|
path.join(folder, "zlib/contrib/minizip/crypt.h"),
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
|
|
||||||
-- Disable warnings. They do not have any value to us since it is not our code.
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
warnings "off"
|
warnings "off"
|
||||||
|
24
thirdparty/salsa20.lua
vendored
24
thirdparty/salsa20.lua
vendored
@ -1,28 +1,30 @@
|
|||||||
salsa20 = {}
|
salsa20 = {}
|
||||||
|
|
||||||
function salsa20:include()
|
function salsa20:include(includes)
|
||||||
if References:include("salsa20") then
|
if includes:handle(self:name()) then
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ThirdPartyFolder(), "salsa20")
|
path.join(ThirdPartyFolder(), "salsa20")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function salsa20:link()
|
function salsa20:link(links)
|
||||||
if References:link("salsa20") then
|
links:add(self:name())
|
||||||
links "salsa20"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function salsa20:use()
|
function salsa20:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function salsa20:project()
|
function salsa20:name()
|
||||||
References:reset()
|
return "salsa20"
|
||||||
local folder = ThirdPartyFolder();
|
end
|
||||||
|
|
||||||
project "salsa20"
|
function salsa20:project()
|
||||||
|
local folder = ThirdPartyFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -33,7 +35,7 @@ function salsa20:project()
|
|||||||
path.join(folder, "salsa20/*.c")
|
path.join(folder, "salsa20/*.c")
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
|
|
||||||
-- Disable warnings. They do not have any value to us since it is not our code.
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
warnings "off"
|
warnings "off"
|
||||||
|
24
thirdparty/zlib.lua
vendored
24
thirdparty/zlib.lua
vendored
@ -1,7 +1,7 @@
|
|||||||
zlib = {}
|
zlib = {}
|
||||||
|
|
||||||
function zlib:include()
|
function zlib:include(includes)
|
||||||
if References:include("zlib") then
|
if includes:handle(self:name()) then
|
||||||
defines {
|
defines {
|
||||||
"ZLIB_CONST"
|
"ZLIB_CONST"
|
||||||
}
|
}
|
||||||
@ -12,21 +12,23 @@ function zlib:include()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function zlib:link()
|
function zlib:link(links)
|
||||||
if References:link("zlib") then
|
links:add(self:name())
|
||||||
links "zlib"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function zlib:use()
|
function zlib:use()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function zlib:project()
|
function zlib:name()
|
||||||
References:reset()
|
return "zlib"
|
||||||
local folder = ThirdPartyFolder();
|
end
|
||||||
|
|
||||||
project "zlib"
|
function zlib:project()
|
||||||
|
local folder = ThirdPartyFolder()
|
||||||
|
local includes = Includes:create()
|
||||||
|
|
||||||
|
project(self:name())
|
||||||
targetdir(TargetDirectoryLib)
|
targetdir(TargetDirectoryLib)
|
||||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -42,7 +44,7 @@ function zlib:project()
|
|||||||
"_CRT_NONSTDC_NO_DEPRECATE"
|
"_CRT_NONSTDC_NO_DEPRECATE"
|
||||||
}
|
}
|
||||||
|
|
||||||
self:include()
|
self:include(includes)
|
||||||
|
|
||||||
-- Disable warnings. They do not have any value to us since it is not our code.
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
warnings "off"
|
warnings "off"
|
||||||
|
25
tools/scripts/folders.lua
Normal file
25
tools/scripts/folders.lua
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
-- 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
|
||||||
|
|
||||||
|
-- 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"
|
20
tools/scripts/including.lua
Normal file
20
tools/scripts/including.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
-- Functions for including projects
|
||||||
|
Includes = {}
|
||||||
|
|
||||||
|
function Includes:create()
|
||||||
|
|
||||||
|
list = {
|
||||||
|
handles = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function list:handle(name)
|
||||||
|
if self.handles[name] == nil then
|
||||||
|
self.handles[name] = true
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return list
|
||||||
|
end
|
48
tools/scripts/linking.lua
Normal file
48
tools/scripts/linking.lua
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
-- Functions for linking projects
|
||||||
|
Links = {}
|
||||||
|
|
||||||
|
function Links:create()
|
||||||
|
|
||||||
|
list = {
|
||||||
|
stack = {},
|
||||||
|
dependencies = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function list:linkto(project)
|
||||||
|
local projectName = project:name()
|
||||||
|
for i, dependency in ipairs(self.stack) do
|
||||||
|
if dependency == projectName then
|
||||||
|
print "Circular dependency detected:"
|
||||||
|
local dependencyList = projectName
|
||||||
|
for j = i + 1, #self.stack do
|
||||||
|
dependencyList = dependencyList .. " -> " .. self.stack[j]
|
||||||
|
end
|
||||||
|
dependencyList = dependencyList .. " -> " .. projectName
|
||||||
|
print(dependencyList)
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(self.stack, projectName)
|
||||||
|
project:link(self)
|
||||||
|
table.remove(self.stack)
|
||||||
|
end
|
||||||
|
|
||||||
|
function list:add(name)
|
||||||
|
for i = 1, #self.dependencies do
|
||||||
|
if self.dependencies[i] == name then
|
||||||
|
table.remove(self.dependencies, i)
|
||||||
|
i = i - 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.insert(self.dependencies, name)
|
||||||
|
end
|
||||||
|
|
||||||
|
function list:linkall()
|
||||||
|
for i, dependency in ipairs(self.dependencies) do
|
||||||
|
links(dependency)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return list
|
||||||
|
end
|
0
tools/scripts/options.lua
Normal file
0
tools/scripts/options.lua
Normal file
8
tools/scripts/platform.lua
Normal file
8
tools/scripts/platform.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
-- Platform functions
|
||||||
|
function ExecutableByOs(name)
|
||||||
|
if os.host() == "windows" then
|
||||||
|
return name .. ".exe"
|
||||||
|
else
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user