From 369267ef39d4996dd22c90cb53582cbd2a3c29c5 Mon Sep 17 00:00:00 2001 From: /dev/root Date: Thu, 25 Aug 2016 18:17:47 +0200 Subject: [PATCH] added submodules for bitmrc --- .gitmodules | 6 ++++ deps/bitmrc | 1 + deps/libcryptopp | 1 + premake/bitmrc.lua | 52 ++++++++++++++++++++++++++++ premake/libcryptopp.lua | 49 ++++++++++++++++++++++++++ premake5.lua | 14 ++++++++ src/Components/Modules/Exception.cpp | 1 + src/STDInclude.hpp | 2 ++ 8 files changed, 126 insertions(+) create mode 160000 deps/bitmrc create mode 160000 deps/libcryptopp create mode 100644 premake/bitmrc.lua create mode 100644 premake/libcryptopp.lua diff --git a/.gitmodules b/.gitmodules index dc5c9e50..2af34286 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/deps/bitmrc b/deps/bitmrc new file mode 160000 index 00000000..92a1bb86 --- /dev/null +++ b/deps/bitmrc @@ -0,0 +1 @@ +Subproject commit 92a1bb86fbab92896ab53cbc102e51531fa281ca diff --git a/deps/libcryptopp b/deps/libcryptopp new file mode 160000 index 00000000..65e91a8c --- /dev/null +++ b/deps/libcryptopp @@ -0,0 +1 @@ +Subproject commit 65e91a8caa8c1846cb311bc83d8507e12699d6d3 diff --git a/premake/bitmrc.lua b/premake/bitmrc.lua new file mode 100644 index 00000000..5513e4d1 --- /dev/null +++ b/premake/bitmrc.lua @@ -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 diff --git a/premake/libcryptopp.lua b/premake/libcryptopp.lua new file mode 100644 index 00000000..fea7ec83 --- /dev/null +++ b/premake/libcryptopp.lua @@ -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 diff --git a/premake5.lua b/premake5.lua index 49f45a63..87f1a491 100644 --- a/premake5.lua +++ b/premake5.lua @@ -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" diff --git a/src/Components/Modules/Exception.cpp b/src/Components/Modules/Exception.cpp index 12aafa65..97fd4aa2 100644 --- a/src/Components/Modules/Exception.cpp +++ b/src/Components/Modules/Exception.cpp @@ -1,5 +1,6 @@ #include "STDInclude.hpp" + // Stuff causes warnings #pragma warning(push) #pragma warning(disable: 4091) diff --git a/src/STDInclude.hpp b/src/STDInclude.hpp index 73032776..98bbbfc3 100644 --- a/src/STDInclude.hpp +++ b/src/STDInclude.hpp @@ -60,6 +60,8 @@ #include #include #include +// Bitmessage +#include #ifdef max #undef max