mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 06:49:28 -05:00
Rework depedency management in premake lua scripts
This commit is contained in:
5
thirdparty/catch2.lua
vendored
5
thirdparty/catch2.lua
vendored
@ -1,7 +1,7 @@
|
||||
catch2 = {}
|
||||
|
||||
function catch2:include()
|
||||
if References:include(self:name()) then
|
||||
function catch2:include(includes)
|
||||
if includes:handle(self:name()) then
|
||||
includedirs {
|
||||
path.join(ThirdPartyFolder(), "catch2", "single_include")
|
||||
}
|
||||
@ -20,5 +20,4 @@ function catch2:name()
|
||||
end
|
||||
|
||||
function catch2:project()
|
||||
References:reset()
|
||||
end
|
||||
|
27
thirdparty/libtomcrypt.lua
vendored
27
thirdparty/libtomcrypt.lua
vendored
@ -1,7 +1,7 @@
|
||||
libtomcrypt = {}
|
||||
|
||||
function libtomcrypt:include()
|
||||
if References:include("libtomcrypt") then
|
||||
function libtomcrypt:include(includes)
|
||||
if includes:handle(self:name()) then
|
||||
defines{
|
||||
"LTM_DESC"
|
||||
}
|
||||
@ -12,21 +12,24 @@ function libtomcrypt:include()
|
||||
end
|
||||
end
|
||||
|
||||
function libtomcrypt:link()
|
||||
if References:link("libtomcrypt") then
|
||||
links "libtomcrypt"
|
||||
end
|
||||
function libtomcrypt:link(links)
|
||||
links:add(self:name())
|
||||
links:linkto(libtommath)
|
||||
end
|
||||
|
||||
function libtomcrypt:use()
|
||||
|
||||
end
|
||||
|
||||
function libtomcrypt:project()
|
||||
References:reset()
|
||||
local folder = ThirdPartyFolder();
|
||||
function libtomcrypt:name()
|
||||
return "libtomcrypt"
|
||||
end
|
||||
|
||||
project "libtomcrypt"
|
||||
function libtomcrypt:project()
|
||||
local folder = ThirdPartyFolder()
|
||||
local includes = Includes:create()
|
||||
|
||||
project(self:name())
|
||||
targetdir(TargetDirectoryLib)
|
||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||
kind "StaticLib"
|
||||
@ -45,8 +48,8 @@ function libtomcrypt:project()
|
||||
"LTC_NO_PROTOTYPES"
|
||||
}
|
||||
|
||||
self:include()
|
||||
libtommath:include()
|
||||
self:include(includes)
|
||||
libtommath:include(includes)
|
||||
|
||||
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||
warnings "off"
|
||||
|
24
thirdparty/libtommath.lua
vendored
24
thirdparty/libtommath.lua
vendored
@ -1,28 +1,30 @@
|
||||
libtommath = {}
|
||||
|
||||
function libtommath:include()
|
||||
if References:include("libtommath") then
|
||||
function libtommath:include(includes)
|
||||
if includes:handle(self:name()) then
|
||||
includedirs {
|
||||
path.join(ThirdPartyFolder(), "libtommath")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function libtommath:link()
|
||||
if References:link("libtommath") then
|
||||
links "libtommath"
|
||||
end
|
||||
function libtommath:link(links)
|
||||
links:add(self:name())
|
||||
end
|
||||
|
||||
function libtommath:use()
|
||||
|
||||
end
|
||||
|
||||
function libtommath:project()
|
||||
References:reset()
|
||||
local folder = ThirdPartyFolder();
|
||||
function libtommath:name()
|
||||
return "libtommath"
|
||||
end
|
||||
|
||||
project "libtommath"
|
||||
function libtommath:project()
|
||||
local folder = ThirdPartyFolder()
|
||||
local includes = Includes:create()
|
||||
|
||||
project(self:name())
|
||||
targetdir(TargetDirectoryLib)
|
||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||
kind "StaticLib"
|
||||
@ -33,7 +35,7 @@ function libtommath:project()
|
||||
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.
|
||||
warnings "off"
|
||||
|
24
thirdparty/minilzo.lua
vendored
24
thirdparty/minilzo.lua
vendored
@ -1,28 +1,30 @@
|
||||
minilzo = {}
|
||||
|
||||
function minilzo:include()
|
||||
if References:include("minilzo") then
|
||||
function minilzo:include(includes)
|
||||
if includes:handle(self:name()) then
|
||||
includedirs {
|
||||
path.join(ThirdPartyFolder(), "minilzo")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function minilzo:link()
|
||||
if References:link("minilzo") then
|
||||
links "minilzo"
|
||||
end
|
||||
function minilzo:link(links)
|
||||
links:add(self:name())
|
||||
end
|
||||
|
||||
function minilzo:use()
|
||||
|
||||
end
|
||||
|
||||
function minilzo:project()
|
||||
References:reset()
|
||||
local folder = ThirdPartyFolder();
|
||||
function minilzo:name()
|
||||
return "minilzo"
|
||||
end
|
||||
|
||||
project "minilzo"
|
||||
function minilzo:project()
|
||||
local folder = ThirdPartyFolder()
|
||||
local includes = Includes:create()
|
||||
|
||||
project(self:name())
|
||||
targetdir(TargetDirectoryLib)
|
||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||
kind "StaticLib"
|
||||
@ -33,7 +35,7 @@ function minilzo:project()
|
||||
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.
|
||||
warnings "off"
|
||||
|
28
thirdparty/minizip.lua
vendored
28
thirdparty/minizip.lua
vendored
@ -1,30 +1,32 @@
|
||||
minizip = {}
|
||||
|
||||
function minizip:include()
|
||||
if References:include("minizip") then
|
||||
zlib:include()
|
||||
function minizip:include(includes)
|
||||
if includes:handle(self:name()) then
|
||||
zlib:include(includes)
|
||||
includedirs {
|
||||
path.join(ThirdPartyFolder(), "zlib/contrib/minizip")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function minizip:link()
|
||||
if References:link("minizip") then
|
||||
zlib:link()
|
||||
links "minizip"
|
||||
end
|
||||
function minizip:link(links)
|
||||
links:add(self:name())
|
||||
links:linkto(zlib)
|
||||
end
|
||||
|
||||
function minizip:use()
|
||||
|
||||
end
|
||||
|
||||
function minizip:project()
|
||||
References:reset()
|
||||
local folder = ThirdPartyFolder();
|
||||
function minizip:name()
|
||||
return "minizip"
|
||||
end
|
||||
|
||||
project "minizip"
|
||||
function minizip:project()
|
||||
local folder = ThirdPartyFolder()
|
||||
local includes = Includes:create()
|
||||
|
||||
project(self:name())
|
||||
targetdir(TargetDirectoryLib)
|
||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||
kind "StaticLib"
|
||||
@ -40,7 +42,7 @@ function minizip:project()
|
||||
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.
|
||||
warnings "off"
|
||||
|
24
thirdparty/salsa20.lua
vendored
24
thirdparty/salsa20.lua
vendored
@ -1,28 +1,30 @@
|
||||
salsa20 = {}
|
||||
|
||||
function salsa20:include()
|
||||
if References:include("salsa20") then
|
||||
function salsa20:include(includes)
|
||||
if includes:handle(self:name()) then
|
||||
includedirs {
|
||||
path.join(ThirdPartyFolder(), "salsa20")
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function salsa20:link()
|
||||
if References:link("salsa20") then
|
||||
links "salsa20"
|
||||
end
|
||||
function salsa20:link(links)
|
||||
links:add(self:name())
|
||||
end
|
||||
|
||||
function salsa20:use()
|
||||
|
||||
end
|
||||
|
||||
function salsa20:project()
|
||||
References:reset()
|
||||
local folder = ThirdPartyFolder();
|
||||
function salsa20:name()
|
||||
return "salsa20"
|
||||
end
|
||||
|
||||
project "salsa20"
|
||||
function salsa20:project()
|
||||
local folder = ThirdPartyFolder()
|
||||
local includes = Includes:create()
|
||||
|
||||
project(self:name())
|
||||
targetdir(TargetDirectoryLib)
|
||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||
kind "StaticLib"
|
||||
@ -33,7 +35,7 @@ function salsa20:project()
|
||||
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.
|
||||
warnings "off"
|
||||
|
24
thirdparty/zlib.lua
vendored
24
thirdparty/zlib.lua
vendored
@ -1,7 +1,7 @@
|
||||
zlib = {}
|
||||
|
||||
function zlib:include()
|
||||
if References:include("zlib") then
|
||||
function zlib:include(includes)
|
||||
if includes:handle(self:name()) then
|
||||
defines {
|
||||
"ZLIB_CONST"
|
||||
}
|
||||
@ -12,21 +12,23 @@ function zlib:include()
|
||||
end
|
||||
end
|
||||
|
||||
function zlib:link()
|
||||
if References:link("zlib") then
|
||||
links "zlib"
|
||||
end
|
||||
function zlib:link(links)
|
||||
links:add(self:name())
|
||||
end
|
||||
|
||||
function zlib:use()
|
||||
|
||||
end
|
||||
|
||||
function zlib:project()
|
||||
References:reset()
|
||||
local folder = ThirdPartyFolder();
|
||||
function zlib:name()
|
||||
return "zlib"
|
||||
end
|
||||
|
||||
project "zlib"
|
||||
function zlib:project()
|
||||
local folder = ThirdPartyFolder()
|
||||
local includes = Includes:create()
|
||||
|
||||
project(self:name())
|
||||
targetdir(TargetDirectoryLib)
|
||||
location "%{wks.location}/thirdparty/%{prj.name}"
|
||||
kind "StaticLib"
|
||||
@ -42,7 +44,7 @@ function zlib:project()
|
||||
"_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.
|
||||
warnings "off"
|
||||
|
Reference in New Issue
Block a user