[Submodules] Add DHT

This commit is contained in:
momo5502 2017-09-02 11:59:04 +02:00
parent 6e7c307693
commit 7c79a4e5a5
4 changed files with 55 additions and 0 deletions

3
.gitmodules vendored
View File

@ -32,3 +32,6 @@
[submodule "deps/iw4mvm"]
path = deps/iw4mvm
url = ../../luckyy/IW4MVM_IW4X.git
[submodule "deps/dht"]
path = deps/dht
url = ../dht.git

1
deps/dht vendored Submodule

@ -0,0 +1 @@
Subproject commit 54ee76af630f56cb97646bc770b88bfb592fd328

44
premake/dht.lua Normal file
View File

@ -0,0 +1,44 @@
dht = {
settings = nil
}
function dht.setup(settings)
if not settings.source then error("Missing source.") end
dht.settings = settings
if not dht.settings.defines then dht.settings.defines = {} end
end
function dht.import()
if not dht.settings then error("You need to call dht.setup first") end
links { "dht" }
dht.includes()
end
function dht.includes()
if not dht.settings then error("You need to call dht.setup first") end
includedirs { dht.settings.source }
defines(dht.settings.defines)
end
function dht.project()
if not dht.settings then error("You need to call dht.setup first") end
project "dht"
language "C"
dht.includes()
files
{
path.join(dht.settings.source, "dht.h"),
path.join(dht.settings.source, "dht.c"),
}
-- not our code, ignore POSIX usage warnings for now
warnings "Off"
kind "StaticLib"
end

View File

@ -182,6 +182,7 @@ require "premake/protobuf"
require "premake/zlib"
require "premake/udis86"
require "premake/iw4mvm"
require "premake/dht"
json11.setup
{
@ -236,6 +237,10 @@ iw4mvm.setup
},
source = path.join(depsBasePath, "iw4mvm"),
}
dht.setup
{
source = path.join(depsBasePath, "dht"),
}
workspace "iw4x"
location "./build"
@ -324,6 +329,7 @@ workspace "iw4x"
zlib.import()
udis86.import()
iw4mvm.import()
dht.import()
-- fix vpaths for protobuf sources
vpaths
@ -437,6 +443,7 @@ workspace "iw4x"
zlib.project()
udis86.project()
iw4mvm.project()
dht.project()
rule "ProtobufCompiler"
display "Protobuf compiler"