diff --git a/.gitmodules b/.gitmodules index ce7ff41e..39e5c987 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,3 +17,6 @@ [submodule "deps/libtommath"] path = deps/libtommath url = https://github.com/libtom/libtommath.git +[submodule "deps/protobuf"] + path = deps/protobuf + url = https://github.com/google/protobuf.git diff --git a/deps/protobuf b/deps/protobuf new file mode 160000 index 00000000..bc215089 --- /dev/null +++ b/deps/protobuf @@ -0,0 +1 @@ +Subproject commit bc215089ca7d9da3a2b313b250d1dee665eda438 diff --git a/premake5.lua b/premake5.lua index 549541f1..1e52785e 100644 --- a/premake5.lua +++ b/premake5.lua @@ -100,7 +100,7 @@ workspace "iw4x" buildoptions { "-Zm88" } -- Dependency on zlib, json11 and asio - links { "zlib", "json11", "pdcurses", "libtomcrypt", "libtommath" } + links { "zlib", "json11", "pdcurses", "libtomcrypt", "libtommath", "protobuf" } includedirs { "./deps/zlib", @@ -109,6 +109,7 @@ workspace "iw4x" "./deps/asio/asio/include", "./deps/libtomcrypt/src/headers", "./deps/libtommath", + "./deps/protobuf/src", } -- Virtual paths @@ -246,3 +247,36 @@ workspace "iw4x" -- always build as static lib, as pdcurses doesn't export anything kind "StaticLib" + + -- protobuf + project "protobuf" + language "C++" + links { "zlib" } + defines { "_SCL_SECURE_NO_WARNINGS" } + includedirs + { + "./deps/zlib", + "./deps/protobuf/src", + } + + files { "./deps/protobuf/src/**.cc" } + + -- remove unnecessary sources + removefiles + { + "./deps/protobuf/src/**/*test.cc", + "./deps/protobuf/src/google/protobuf/*test*.cc", + + "./deps/protobuf/src/google/protobuf/testing/**.cc", + "./deps/protobuf/src/google/protobuf/compiler/**.cc", + + "./deps/protobuf/src/google/protobuf/arena_nc.cc", + "./deps/protobuf/src/google/protobuf/util/internal/error_listener.cc", + "./deps/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", + } + + -- not our code, ignore POSIX usage warnings for now + warnings "Off" + + -- always build as static lib, as pdcurses doesn't export anything + kind "StaticLib"