mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
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:
@ -1,16 +1,20 @@
|
||||
Crypto = {}
|
||||
|
||||
function Crypto:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Crypto")
|
||||
}
|
||||
if References:include("Crypto") then
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Crypto")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function Crypto:link()
|
||||
libtomcrypt:link()
|
||||
libtommath:link()
|
||||
salsa20:link()
|
||||
links "Crypto"
|
||||
if References:link("Crypto") then
|
||||
libtomcrypt:link()
|
||||
libtommath:link()
|
||||
salsa20:link()
|
||||
links "Crypto"
|
||||
end
|
||||
end
|
||||
|
||||
function Crypto:use()
|
||||
@ -18,6 +22,7 @@ function Crypto:use()
|
||||
end
|
||||
|
||||
function Crypto:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "Crypto"
|
||||
|
@ -1,9 +1,11 @@
|
||||
Linker = {}
|
||||
|
||||
function Linker:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Linker")
|
||||
}
|
||||
if References:include("Linker") then
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Linker")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function Linker:link()
|
||||
@ -15,6 +17,7 @@ function Linker:use()
|
||||
end
|
||||
|
||||
function Linker:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "Linker"
|
||||
|
@ -1,20 +1,24 @@
|
||||
ObjCommon = {}
|
||||
|
||||
function ObjCommon:include()
|
||||
ZoneCommon:include()
|
||||
minizip:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ObjCommon")
|
||||
}
|
||||
if References:include("ObjCommon") then
|
||||
ZoneCommon:include()
|
||||
minizip:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ObjCommon")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ObjCommon:link()
|
||||
Utils:link()
|
||||
ZoneCommon:link()
|
||||
minizip:link()
|
||||
links {
|
||||
"ObjCommon"
|
||||
}
|
||||
if References:link("ObjCommon") then
|
||||
Utils:link()
|
||||
ZoneCommon:link()
|
||||
minizip:link()
|
||||
links {
|
||||
"ObjCommon"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ObjCommon:use()
|
||||
@ -22,6 +26,7 @@ function ObjCommon:use()
|
||||
end
|
||||
|
||||
function ObjCommon:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ObjCommon"
|
||||
|
@ -1,23 +1,27 @@
|
||||
ObjLoading = {}
|
||||
|
||||
function ObjLoading:include()
|
||||
ObjCommon:include()
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ObjLoading")
|
||||
}
|
||||
if References:include("ObjLoading") then
|
||||
ObjCommon:include()
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ObjLoading")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ObjLoading:link()
|
||||
Utils:link()
|
||||
ObjCommon:link()
|
||||
ZoneCommon:link()
|
||||
minilzo:link()
|
||||
minizip:link()
|
||||
zlib:link()
|
||||
links {
|
||||
"ObjLoading"
|
||||
}
|
||||
if References:link("ObjLoading") then
|
||||
Utils:link()
|
||||
ObjCommon:link()
|
||||
ZoneCommon:link()
|
||||
minilzo:link()
|
||||
minizip:link()
|
||||
zlib:link()
|
||||
links {
|
||||
"ObjLoading"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ObjLoading:use()
|
||||
@ -25,6 +29,7 @@ function ObjLoading:use()
|
||||
end
|
||||
|
||||
function ObjLoading:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ObjLoading"
|
||||
|
@ -1,22 +1,26 @@
|
||||
ObjWriting = {}
|
||||
|
||||
function ObjWriting:include()
|
||||
ObjCommon:include()
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ObjWriting")
|
||||
}
|
||||
if References:include("ObjWriting") then
|
||||
ObjCommon:include()
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ObjWriting")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ObjWriting:link()
|
||||
Utils:link()
|
||||
ObjCommon:link()
|
||||
ZoneCommon:link()
|
||||
minilzo:link()
|
||||
minizip:link()
|
||||
links {
|
||||
"ObjWriting"
|
||||
}
|
||||
if References:link("ObjWriting") then
|
||||
Utils:link()
|
||||
ObjCommon:link()
|
||||
ZoneCommon:link()
|
||||
minilzo:link()
|
||||
minizip:link()
|
||||
links {
|
||||
"ObjWriting"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ObjWriting:use()
|
||||
@ -24,6 +28,7 @@ function ObjWriting:use()
|
||||
end
|
||||
|
||||
function ObjWriting:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ObjWriting"
|
||||
|
@ -1,9 +1,11 @@
|
||||
Unlinker = {}
|
||||
|
||||
function Unlinker:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Unlinker")
|
||||
}
|
||||
if References:include("Unlinker") then
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Unlinker")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function Unlinker:link()
|
||||
@ -15,6 +17,7 @@ function Unlinker:use()
|
||||
end
|
||||
|
||||
function Unlinker:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "Unlinker"
|
||||
|
@ -1,13 +1,17 @@
|
||||
Utils = {}
|
||||
|
||||
function Utils:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Utils")
|
||||
}
|
||||
if References:include("Utils") then
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "Utils")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function Utils:link()
|
||||
links "Utils"
|
||||
if References:link("Utils") then
|
||||
links "Utils"
|
||||
end
|
||||
end
|
||||
|
||||
function Utils:use()
|
||||
@ -15,6 +19,7 @@ function Utils:use()
|
||||
end
|
||||
|
||||
function Utils:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "Utils"
|
||||
|
@ -108,10 +108,12 @@ function ZoneCode:allWriteFiles()
|
||||
end
|
||||
|
||||
function ZoneCode:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneCode"),
|
||||
"%{wks.location}/src/ZoneCode"
|
||||
}
|
||||
if References:include("ZoneCode") then
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneCode"),
|
||||
"%{wks.location}/src/ZoneCode"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneCode:link()
|
||||
@ -123,6 +125,7 @@ function ZoneCode:use()
|
||||
end
|
||||
|
||||
function ZoneCode:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ZoneCode"
|
||||
|
@ -5,7 +5,9 @@ function ZoneCodeGenerator:include()
|
||||
end
|
||||
|
||||
function ZoneCodeGenerator:link()
|
||||
links "ZoneCodeGenerator"
|
||||
if References:link("ZoneCodeGenerator") then
|
||||
links "ZoneCodeGenerator"
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneCodeGenerator:use()
|
||||
@ -13,6 +15,7 @@ function ZoneCodeGenerator:use()
|
||||
end
|
||||
|
||||
function ZoneCodeGenerator:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ZoneCodeGenerator"
|
||||
|
@ -1,17 +1,23 @@
|
||||
ZoneCommon = {}
|
||||
|
||||
function ZoneCommon:include()
|
||||
Utils:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneCommon")
|
||||
}
|
||||
if References:include("ZoneCommon") then
|
||||
Utils:include()
|
||||
ObjCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneCommon")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneCommon:link()
|
||||
Utils:link()
|
||||
links {
|
||||
"ZoneCommon"
|
||||
}
|
||||
if References:link("ZoneCommon") then
|
||||
Utils:link()
|
||||
ObjCommon:link()
|
||||
links {
|
||||
"ZoneCommon"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneCommon:use()
|
||||
@ -19,6 +25,7 @@ function ZoneCommon:use()
|
||||
end
|
||||
|
||||
function ZoneCommon:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ZoneCommon"
|
||||
|
@ -1,20 +1,24 @@
|
||||
ZoneLoading = {}
|
||||
|
||||
function ZoneLoading:include()
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneLoading")
|
||||
}
|
||||
if References:include("ZoneLoading") then
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneLoading")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneLoading:link()
|
||||
Crypto:link()
|
||||
Utils:link()
|
||||
ZoneCommon:link()
|
||||
zlib:link()
|
||||
links {
|
||||
"ZoneLoading"
|
||||
}
|
||||
if References:link("ZoneLoading") then
|
||||
Crypto:link()
|
||||
Utils:link()
|
||||
ZoneCommon:link()
|
||||
zlib:link()
|
||||
links {
|
||||
"ZoneLoading"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneLoading:use()
|
||||
@ -22,6 +26,7 @@ function ZoneLoading:use()
|
||||
end
|
||||
|
||||
function ZoneLoading:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ZoneLoading"
|
||||
|
@ -1,20 +1,24 @@
|
||||
ZoneWriting = {}
|
||||
|
||||
function ZoneWriting:include()
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneWriting")
|
||||
}
|
||||
if References:include("ZoneWriting") then
|
||||
ZoneCommon:include()
|
||||
includedirs {
|
||||
path.join(ProjectFolder(), "ZoneWriting")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneWriting:link()
|
||||
Crypto:link()
|
||||
Utils:link()
|
||||
ZoneCommon:link()
|
||||
zlib:link()
|
||||
links {
|
||||
"ZoneWriting"
|
||||
}
|
||||
if References:link("ZoneWriting") then
|
||||
Crypto:link()
|
||||
Utils:link()
|
||||
ZoneCommon:link()
|
||||
zlib:link()
|
||||
links {
|
||||
"ZoneWriting"
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function ZoneWriting:use()
|
||||
@ -22,6 +26,7 @@ function ZoneWriting:use()
|
||||
end
|
||||
|
||||
function ZoneWriting:project()
|
||||
References:reset()
|
||||
local folder = ProjectFolder();
|
||||
|
||||
project "ZoneWriting"
|
||||
|
Reference in New Issue
Block a user