mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Add premake scripts for projects
This commit is contained in:
parent
cae05efb7b
commit
0d103e24a5
52
premake5.lua
52
premake5.lua
@ -68,19 +68,55 @@ workspace "OpenAssetTools"
|
|||||||
-- ========================
|
-- ========================
|
||||||
-- ThirdParty
|
-- ThirdParty
|
||||||
-- ========================
|
-- ========================
|
||||||
|
|
||||||
include "thirdparty/libtomcrypt.lua"
|
include "thirdparty/libtomcrypt.lua"
|
||||||
include "thirdparty/libtommath.lua"
|
include "thirdparty/libtommath.lua"
|
||||||
include "thirdparty/salsa20.lua"
|
include "thirdparty/salsa20.lua"
|
||||||
include "thirdparty/zlib.lua"
|
include "thirdparty/zlib.lua"
|
||||||
|
|
||||||
-- All projects here should be in the thirdparty folder
|
-- ThirdParty group: All projects that are external dependencies
|
||||||
group "thirdparty"
|
group "ThirdParty"
|
||||||
|
libtommath:project()
|
||||||
|
libtomcrypt:project()
|
||||||
|
salsa20:project()
|
||||||
|
zlib:project()
|
||||||
|
group ""
|
||||||
|
|
||||||
libtommath:project()
|
-- ========================
|
||||||
libtomcrypt:project()
|
-- Projects
|
||||||
salsa20:project()
|
-- ========================
|
||||||
zlib:project()
|
include "src/Crypto.lua"
|
||||||
|
include "src/Linker.lua"
|
||||||
|
include "src/Unlinker.lua"
|
||||||
|
include "src/Utils.lua"
|
||||||
|
include "src/ZoneCodeGenerator.lua"
|
||||||
|
include "src/ZoneCommon.lua"
|
||||||
|
include "src/ZoneLoading.lua"
|
||||||
|
include "src/ZoneWriting.lua"
|
||||||
|
|
||||||
-- Reset group
|
-- Components group: All projects assist or are part of a tool
|
||||||
|
group "Components"
|
||||||
|
Crypto:project()
|
||||||
|
Utils:project()
|
||||||
|
--ZoneCodeGenerator:project()
|
||||||
|
ZoneCommon:project()
|
||||||
|
ZoneLoading:project()
|
||||||
|
ZoneWriting:project()
|
||||||
|
group ""
|
||||||
|
|
||||||
|
-- Tools group: All projects that compile into the final tools
|
||||||
|
group "Tools"
|
||||||
|
Linker:project()
|
||||||
|
Unlinker:project()
|
||||||
|
group ""
|
||||||
|
|
||||||
|
-- ========================
|
||||||
|
-- Tests
|
||||||
|
-- ========================
|
||||||
|
include "test/ZoneCodeGeneratorTests.lua"
|
||||||
|
include "test/ZoneCommonTests.lua"
|
||||||
|
|
||||||
|
-- Tests group: Unit test and other tests projects
|
||||||
|
group "Tests"
|
||||||
|
--ZoneCodeGeneratorTests:project()
|
||||||
|
ZoneCommonTests:project()
|
||||||
group ""
|
group ""
|
36
src/Crypto.lua
Normal file
36
src/Crypto.lua
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
Crypto = {}
|
||||||
|
|
||||||
|
function Crypto:include()
|
||||||
|
includedirs {
|
||||||
|
path.join(ProjectFolder(), "Crypto")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Crypto:link()
|
||||||
|
libtomcrypt:link()
|
||||||
|
libtommath:link()
|
||||||
|
salsa20:link()
|
||||||
|
links {
|
||||||
|
"Crypto"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Crypto:project()
|
||||||
|
local folder = ProjectFolder();
|
||||||
|
|
||||||
|
project "Crypto"
|
||||||
|
targetdir(TargetDirectoryLib)
|
||||||
|
location "%{wks.location}/src"
|
||||||
|
kind "StaticLib"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "Crypto/**.h"),
|
||||||
|
path.join(folder, "Crypto/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
libtomcrypt:include()
|
||||||
|
libtommath:include()
|
||||||
|
salsa20:include()
|
||||||
|
end
|
33
src/Linker.lua
Normal file
33
src/Linker.lua
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Linker = {}
|
||||||
|
|
||||||
|
function Linker:include()
|
||||||
|
includedirs {
|
||||||
|
path.join(ProjectFolder(), "Linker")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Linker:link()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function Linker:project()
|
||||||
|
local folder = ProjectFolder();
|
||||||
|
|
||||||
|
project "Linker"
|
||||||
|
targetdir(TargetDirectoryBin)
|
||||||
|
location "%{wks.location}/src"
|
||||||
|
kind "ConsoleApp"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "Linker/**.h"),
|
||||||
|
path.join(folder, "Linker/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
Utils:include()
|
||||||
|
ZoneWriting:include()
|
||||||
|
|
||||||
|
Utils:link()
|
||||||
|
--ZoneWriting:link()
|
||||||
|
end
|
33
src/Unlinker.lua
Normal file
33
src/Unlinker.lua
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Unlinker = {}
|
||||||
|
|
||||||
|
function Unlinker:include()
|
||||||
|
includedirs {
|
||||||
|
path.join(ProjectFolder(), "Unlinker")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Unlinker:link()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function Unlinker:project()
|
||||||
|
local folder = ProjectFolder();
|
||||||
|
|
||||||
|
project "Unlinker"
|
||||||
|
targetdir(TargetDirectoryBin)
|
||||||
|
location "%{wks.location}/src"
|
||||||
|
kind "ConsoleApp"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "Unlinker/**.h"),
|
||||||
|
path.join(folder, "Unlinker/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
Utils:include()
|
||||||
|
ZoneLoading:include()
|
||||||
|
|
||||||
|
Utils:link()
|
||||||
|
ZoneLoading:link()
|
||||||
|
end
|
30
src/Utils.lua
Normal file
30
src/Utils.lua
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
Utils = {}
|
||||||
|
|
||||||
|
function Utils:include()
|
||||||
|
includedirs {
|
||||||
|
path.join(ProjectFolder(), "Utils")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Utils:link()
|
||||||
|
links {
|
||||||
|
"Utils"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Utils:project()
|
||||||
|
local folder = ProjectFolder();
|
||||||
|
|
||||||
|
project "Utils"
|
||||||
|
targetdir(TargetDirectoryLib)
|
||||||
|
location "%{wks.location}/src"
|
||||||
|
kind "StaticLib"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "Utils/**.h"),
|
||||||
|
path.join(folder, "Utils/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
end
|
0
src/ZoneCodeGenerator.lua
Normal file
0
src/ZoneCodeGenerator.lua
Normal file
30
src/ZoneCommon.lua
Normal file
30
src/ZoneCommon.lua
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
ZoneCommon = {}
|
||||||
|
|
||||||
|
function ZoneCommon:include()
|
||||||
|
includedirs {
|
||||||
|
path.join(ProjectFolder(), "ZoneCommon")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneCommon:link()
|
||||||
|
links {
|
||||||
|
"ZoneCommon"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneCommon:project()
|
||||||
|
local folder = ProjectFolder();
|
||||||
|
|
||||||
|
project "ZoneCommon"
|
||||||
|
targetdir(TargetDirectoryLib)
|
||||||
|
location "%{wks.location}/src"
|
||||||
|
kind "StaticLib"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "ZoneCommon/**.h"),
|
||||||
|
path.join(folder, "ZoneCommon/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
end
|
38
src/ZoneLoading.lua
Normal file
38
src/ZoneLoading.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
ZoneLoading = {}
|
||||||
|
|
||||||
|
function ZoneLoading:include()
|
||||||
|
ZoneCommon:include()
|
||||||
|
includedirs {
|
||||||
|
path.join(ProjectFolder(), "ZoneLoading")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneLoading:link()
|
||||||
|
Crypto:link()
|
||||||
|
Utils:link()
|
||||||
|
ZoneCommon:link()
|
||||||
|
zlib:link()
|
||||||
|
links {
|
||||||
|
"ZoneLoading"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneLoading:project()
|
||||||
|
local folder = ProjectFolder();
|
||||||
|
|
||||||
|
project "ZoneLoading"
|
||||||
|
targetdir(TargetDirectoryLib)
|
||||||
|
location "%{wks.location}/src"
|
||||||
|
kind "StaticLib"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "ZoneLoading/**.h"),
|
||||||
|
path.join(folder, "ZoneLoading/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
Crypto:include()
|
||||||
|
Utils:include()
|
||||||
|
zlib:include()
|
||||||
|
end
|
38
src/ZoneWriting.lua
Normal file
38
src/ZoneWriting.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
ZoneWriting = {}
|
||||||
|
|
||||||
|
function ZoneWriting:include()
|
||||||
|
ZoneCommon:include()
|
||||||
|
includedirs {
|
||||||
|
path.join(ProjectFolder(), "ZoneWriting")
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneWriting:link()
|
||||||
|
Crypto:link()
|
||||||
|
Utils:link()
|
||||||
|
ZoneCommon:link()
|
||||||
|
zlib:link()
|
||||||
|
links {
|
||||||
|
"ZoneWriting"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneWriting:project()
|
||||||
|
local folder = ProjectFolder();
|
||||||
|
|
||||||
|
project "ZoneWriting"
|
||||||
|
targetdir(TargetDirectoryLib)
|
||||||
|
location "%{wks.location}/src"
|
||||||
|
kind "StaticLib"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "ZoneWriting/**.h"),
|
||||||
|
path.join(folder, "ZoneWriting/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
Crypto:include()
|
||||||
|
Utils:include()
|
||||||
|
zlib:include()
|
||||||
|
end
|
38
test/ZoneCodeGeneratorTests.lua
Normal file
38
test/ZoneCodeGeneratorTests.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
ZoneCodeGeneratorTests = {}
|
||||||
|
|
||||||
|
function ZoneCodeGeneratorTests:include()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneCodeGeneratorTests:link()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneCodeGeneratorTests:project()
|
||||||
|
local folder = TestFolder();
|
||||||
|
|
||||||
|
project "ZoneCodeGeneratorTests"
|
||||||
|
targetdir(TargetDirectoryTest)
|
||||||
|
location "%{wks.location}/test"
|
||||||
|
kind "SharedLib"
|
||||||
|
language "C#"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "Zone/src/**.h"),
|
||||||
|
path.join(folder, "libtomcrypt/src/**.c")
|
||||||
|
}
|
||||||
|
|
||||||
|
defines {
|
||||||
|
"_CRT_SECURE_NO_WARNINGS",
|
||||||
|
"_CRT_NONSTDC_NO_DEPRECATE",
|
||||||
|
"LTC_SOURCE",
|
||||||
|
"LTC_NO_TEST",
|
||||||
|
"LTC_NO_PROTOTYPES"
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
libtommath:include()
|
||||||
|
|
||||||
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
|
warnings "off"
|
||||||
|
end
|
32
test/ZoneCommonTests.lua
Normal file
32
test/ZoneCommonTests.lua
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
ZoneCommonTests = {}
|
||||||
|
|
||||||
|
function ZoneCommonTests:include()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneCommonTests:link()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function ZoneCommonTests:project()
|
||||||
|
local folder = TestFolder();
|
||||||
|
|
||||||
|
project "ZoneCommonTests"
|
||||||
|
targetdir(TargetDirectoryTest)
|
||||||
|
location "%{wks.location}/test"
|
||||||
|
kind "SharedLib"
|
||||||
|
language "C++"
|
||||||
|
|
||||||
|
files {
|
||||||
|
path.join(folder, "ZoneCommonTests/**.h"),
|
||||||
|
path.join(folder, "ZoneCommonTests/**.cpp")
|
||||||
|
}
|
||||||
|
|
||||||
|
self:include()
|
||||||
|
ZoneCommon:include()
|
||||||
|
|
||||||
|
ZoneCommon:link()
|
||||||
|
|
||||||
|
-- Disable warnings. They do not have any value to us since it is not our code.
|
||||||
|
warnings "off"
|
||||||
|
end
|
5
thirdparty/libtomcrypt.lua
vendored
5
thirdparty/libtomcrypt.lua
vendored
@ -1,13 +1,16 @@
|
|||||||
libtomcrypt = {}
|
libtomcrypt = {}
|
||||||
|
|
||||||
function libtomcrypt:include()
|
function libtomcrypt:include()
|
||||||
|
defines{
|
||||||
|
"LTM_DESC"
|
||||||
|
}
|
||||||
|
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ThirdPartyFolder(), "libtomcrypt/src/headers")
|
path.join(ThirdPartyFolder(), "libtomcrypt/src/headers")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function libtomcrypt:link()
|
function libtomcrypt:link()
|
||||||
self:include()
|
|
||||||
links {
|
links {
|
||||||
"libtomcrypt"
|
"libtomcrypt"
|
||||||
}
|
}
|
||||||
|
1
thirdparty/libtommath.lua
vendored
1
thirdparty/libtommath.lua
vendored
@ -7,7 +7,6 @@ function libtommath:include()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function libtommath:link()
|
function libtommath:link()
|
||||||
self:include()
|
|
||||||
links {
|
links {
|
||||||
"libtommath"
|
"libtommath"
|
||||||
}
|
}
|
||||||
|
1
thirdparty/salsa20.lua
vendored
1
thirdparty/salsa20.lua
vendored
@ -7,7 +7,6 @@ function salsa20:include()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function salsa20:link()
|
function salsa20:link()
|
||||||
self:include()
|
|
||||||
links {
|
links {
|
||||||
"salsa20"
|
"salsa20"
|
||||||
}
|
}
|
||||||
|
6
thirdparty/zlib.lua
vendored
6
thirdparty/zlib.lua
vendored
@ -1,13 +1,17 @@
|
|||||||
zlib = {}
|
zlib = {}
|
||||||
|
|
||||||
function zlib:include()
|
function zlib:include()
|
||||||
|
|
||||||
|
defines {
|
||||||
|
"ZLIB_CONST"
|
||||||
|
}
|
||||||
|
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(ThirdPartyFolder(), "zlib")
|
path.join(ThirdPartyFolder(), "zlib")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function zlib:link()
|
function zlib:link()
|
||||||
self:include()
|
|
||||||
links {
|
links {
|
||||||
"zlib"
|
"zlib"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user