added submodules for bitmrc

This commit is contained in:
/dev/root 2016-08-25 18:17:47 +02:00
parent 7f951dadbd
commit 369267ef39
8 changed files with 126 additions and 0 deletions

6
.gitmodules vendored
View File

@ -29,3 +29,9 @@
[submodule "deps/Wink-Signals"]
path = deps/Wink-Signals
url = https://github.com/miguelmartin75/Wink-Signals.git
[submodule "deps/bitmrc"]
path = deps/bitmrc
url = https://github.com/mrc-g/BitMRC.git
[submodule "deps/libcryptopp"]
path = deps/libcryptopp
url = https://github.com/weidai11/cryptopp.git

1
deps/bitmrc vendored Submodule

@ -0,0 +1 @@
Subproject commit 92a1bb86fbab92896ab53cbc102e51531fa281ca

1
deps/libcryptopp vendored Submodule

@ -0,0 +1 @@
Subproject commit 65e91a8caa8c1846cb311bc83d8507e12699d6d3

52
premake/bitmrc.lua Normal file
View File

@ -0,0 +1,52 @@
bitmrc = {
settings = nil,
}
function bitmrc.setup(settings)
if not settings.source then error("Missing source.") end
bitmrc.settings = settings
end
function bitmrc.import()
if not bitmrc.settings then error("Run bitmrc.setup first") end
bitmrc.includes()
end
function bitmrc.includes()
if not bitmrc.settings then error("Run bitmrc.setup first") end
includedirs { path.join(bitmrc.settings.source, "BitMRC/include") }
end
function bitmrc.project()
if not bitmrc.settings then error("Run bitmrc.setup first") end
project "bitmrc"
language "C++"
includedirs
{
path.join(bitmrc.settings.source, "src"),
}
files
{
path.join(bitmrc.settings.source, "src/**.cc"),
}
removefiles
{
-- path.join(bitmrc.settings.source, "src/**/*test.cc"),
path.join(bitmrc.settings.source, "BitMRC/main.cpp"),
}
-- dependencies
libcryptopp.import()
-- not our code, ignore POSIX usage warnings for now
defines { "_SCL_SECURE_NO_WARNINGS" }
warnings "Off"
-- always build as static lib, as we include our custom classes and therefore can't perform shared linking
kind "StaticLib"
end

49
premake/libcryptopp.lua Normal file
View File

@ -0,0 +1,49 @@
libcryptopp = {
settings = nil,
}
function libcryptopp.setup(settings)
if not settings.source then error("Missing source.") end
libcryptopp.settings = settings
end
function libcryptopp.import()
if not libcryptopp.settings then error("Run libcryptopp.setup first") end
libcryptopp.includes()
end
function libcryptopp.includes()
if not libcryptopp.settings then error("Run libcryptopp.setup first") end
includedirs { libcryptopp.settings.source }
end
function libcryptopp.project()
if not libcryptopp.settings then error("Run libcryptopp.setup first") end
project "libcryptopp"
language "C++"
includedirs
{
libcryptopp.settings.source
}
files
{
path.join(libcryptopp.settings.source, "src/**.cpp"),
}
removefiles
{
path.join(libcryptopp.settings.source, "TestData/**"),
path.join(libcryptopp.settings.source, "TestVectors/**"),
}
-- not our code, ignore POSIX usage warnings for now
defines { "_SCL_SECURE_NO_WARNINGS" }
warnings "Off"
-- always build as static lib, as we include our custom classes and therefore can't perform shared linking
kind "StaticLib"
end

View File

@ -134,6 +134,8 @@ require "premake/pdcurses"
require "premake/protobuf"
require "premake/winksignals"
require "premake/zlib"
require "premake/bitmrc"
require "premake/libcryptopp"
fmt.setup
{
@ -182,6 +184,14 @@ zlib.setup
},
source = path.join(depsBasePath, "zlib"),
}
bitmrc.setup
{
source = path.join(depsBasePath, "bitmrc"),
}
libcryptopp.setup
{
source = path.join(depsBasePath, "libcryptopp"),
}
workspace "iw4x"
location "./build"
@ -254,6 +264,8 @@ workspace "iw4x"
protobuf.import()
winksignals.import()
zlib.import()
bitmrc.import()
libcryptopp.import()
-- fix vpaths for protobuf sources
vpaths
@ -353,6 +365,8 @@ workspace "iw4x"
winksignals.project()
zlib.project()
protobuf.project()
bitmrc.project()
libcryptopp.project()
rule "ProtobufCompiler"
display "Protobuf compiler"

View File

@ -1,5 +1,6 @@
#include "STDInclude.hpp"
// Stuff causes warnings
#pragma warning(push)
#pragma warning(disable: 4091)

View File

@ -60,6 +60,8 @@
#include <json11.hpp>
#include <tomcrypt.h>
#include <wink/signal.hpp>
// Bitmessage
#include <BitMRC.h>
#ifdef max
#undef max