Add premake solution generation for third party projects for now only

This commit is contained in:
Jan 2019-10-22 00:13:38 +02:00
parent fb3b62fa69
commit debb8d481e
8 changed files with 239 additions and 4 deletions

6
.gitignore vendored
View File

@ -16,9 +16,7 @@ ipch/*
.vs/
bin/
lib/
obj/
local/
gen/
obj/
packages/
TestResults/
build/

1
generate.bat Normal file
View File

@ -0,0 +1 @@
tools\premake5 vs2019

86
premake5.lua Normal file
View File

@ -0,0 +1,86 @@
-- Functions for locating commonly used folders
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"
-- ==================
-- Workspace
-- ==================
workspace "OpenAssetTools"
location "build"
objdir "%{wks.location}/obj"
symbols "On"
systemversion "latest"
flags {
"MultiProcessorCompile"
}
configurations {
"Debug",
"Release"
}
platforms {
"x86",
"x64"
}
filter "platforms:x86"
architecture "x86"
defines "ARCH_x86"
filter {}
filter "platforms:x64"
architecture "x86_64"
defines "ARCH_x64"
filter {}
filter "configurations:Debug"
defines "_DEBUG"
optimize "Debug"
filter {}
filter "configurations:Release"
defines "NDEBUG"
optimize "Full"
flags {
"FatalWarnings"
}
filter {}
-- ========================
-- ThirdParty
-- ========================
include "thirdparty/libtomcrypt.lua"
include "thirdparty/libtommath.lua"
include "thirdparty/salsa20.lua"
include "thirdparty/zlib.lua"
-- All projects here should be in the thirdparty folder
group "thirdparty"
libtommath:project()
libtomcrypt:project()
salsa20:project()
zlib:project()
-- Reset group
group ""

43
thirdparty/libtomcrypt.lua vendored Normal file
View File

@ -0,0 +1,43 @@
libtomcrypt = {}
function libtomcrypt:include()
includedirs {
path.join(ThirdPartyFolder(), "libtomcrypt/src/headers")
}
end
function libtomcrypt:link()
self:include()
links {
"libtomcrypt"
}
end
function libtomcrypt:project()
local folder = ThirdPartyFolder();
project "libtomcrypt"
targetdir(TargetDirectoryLib)
location "%{wks.location}/thirdparty"
kind "StaticLib"
language "C"
files {
path.join(folder, "libtomcrypt/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

34
thirdparty/libtommath.lua vendored Normal file
View File

@ -0,0 +1,34 @@
libtommath = {}
function libtommath:include()
includedirs {
path.join(ThirdPartyFolder(), "libtommath")
}
end
function libtommath:link()
self:include()
links {
"libtommath"
}
end
function libtommath:project()
local folder = ThirdPartyFolder();
project "libtommath"
targetdir(TargetDirectoryLib)
location "%{wks.location}/thirdparty"
kind "StaticLib"
language "C"
files {
path.join(folder, "libtommath/*.h"),
path.join(folder, "libtommath/*.c")
}
self:include()
-- Disable warnings. They do not have any value to us since it is not our code.
warnings "off"
end

34
thirdparty/salsa20.lua vendored Normal file
View File

@ -0,0 +1,34 @@
salsa20 = {}
function salsa20:include()
includedirs {
path.join(ThirdPartyFolder(), "salsa20")
}
end
function salsa20:link()
self:include()
links {
"salsa20"
}
end
function salsa20:project()
local folder = ThirdPartyFolder();
project "salsa20"
targetdir(TargetDirectoryLib)
location "%{wks.location}/thirdparty"
kind "StaticLib"
language "C"
files {
path.join(folder, "salsa20/*.h"),
path.join(folder, "salsa20/*.c")
}
self:include()
-- Disable warnings. They do not have any value to us since it is not our code.
warnings "off"
end

39
thirdparty/zlib.lua vendored Normal file
View File

@ -0,0 +1,39 @@
zlib = {}
function zlib:include()
includedirs {
path.join(ThirdPartyFolder(), "zlib")
}
end
function zlib:link()
self:include()
links {
"zlib"
}
end
function zlib:project()
local folder = ThirdPartyFolder();
project "zlib"
targetdir(TargetDirectoryLib)
location "%{wks.location}/thirdparty"
kind "StaticLib"
language "C"
files {
path.join(folder, "zlib/*.h"),
path.join(folder, "zlib/*.c")
}
defines {
"_CRT_SECURE_NO_WARNINGS",
"_CRT_NONSTDC_NO_DEPRECATE"
}
self:include()
-- Disable warnings. They do not have any value to us since it is not our code.
warnings "off"
end

BIN
tools/premake5.exe Normal file

Binary file not shown.