diff --git a/.gitmodules b/.gitmodules index 2f85c0ab3..94115f227 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "dependencies/spirit-po"] path = dependencies/spirit-po url = https://github.com/cbeck88/spirit-po.git +[submodule "dependencies/grpc"] + path = dependencies/grpc + url = https://github.com/grpc/grpc.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f4e05b75..e544d1bac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories( "dependencies/mariadb-connector-c/include" "dependencies/mariadb-connector-c/build/include" "dependencies/spirit-po/include" + "dependencies/grpc/include" "src/cpp/proto" #"dependencies/mariadb-connector-c/build/include" #"dependencies/mariadb-connector-c/include" @@ -91,6 +92,10 @@ find_library(MYSQL_LIBRARIES mariadbclient.lib PATHS "dependencies/mariadb-conne #find_library(MYSQL_LIBRARIES_DEBUG mariadbclient.lib PATHS "import/mariadb/lib/debug") find_library(COMPILED_MARIADB_CLIENT_DEBUG mariadbclient PATHS "dependencies/mariadb-connector-c/build/libmariadb/Debug" REQUIRED) find_library(IROHA_ED25519 ed25519 PATHS "dependencies/iroha-ed25519/build/Debug" REQUIRED) +set(GRPC_PATH "dependencies/grpc/_build/Debug") +find_library(GRPC_PLUSPLUS grpc++ PATHS ${GRPC_PATH} REQUIRED) +find_library(GRPC_REFLECTION grpc++_reflection PATHS ${GRPC_PATH} REQUIRED) +set(GRPC_LIBS ${GRPC_PLUSPLUS} ${GRPC_REFLECTION}) set(MYSQL_INCLUDE_DIR "dependencies/mariadb-connector-c/include") #set(POCO_DEBUG_PATH "I:/FremdCode/C++/poco/win64/lib/Debug") @@ -139,6 +144,7 @@ target_link_libraries(Gradido_LoginServer ${CONAN_LIBS} ${IROHA_ED25519}) if(WIN32) TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi) TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi) +TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${GRPC_LIBS}) else(WIN32) target_link_libraries(Gradido_LoginServer libmariadb protoc protobuf -pthread) endif(WIN32) diff --git a/README b/README index f6ca48a88..89783a878 100644 --- a/README +++ b/README @@ -20,6 +20,13 @@ cmake -DWITH_SSL=OFF .. cd ../../../ +cd dependencies/grpc +mkdir _build +cd _build +cmake .. +make +cd ../../../ + # get more dependencies with conan (need conan from https://conan.io/) mkdir build && cd build conan remote add inexor https://api.bintray.com/conan/inexorgame/inexor-conan diff --git a/compile_proto.sh b/compile_proto.sh index 16e3f975f..7e823733d 100755 --- a/compile_proto.sh +++ b/compile_proto.sh @@ -6,12 +6,13 @@ if [ ! -d "./src/cpp/proto/gradido" ] ; then mkdir ./src/cpp/proto/gradido fi -protoc --cpp_out=./src/cpp/proto --proto_path=./src/proto ./src/proto/gradido/*.proto +./protoc --cpp_out=./src/cpp/proto --proto_path=./src/proto ./src/proto/gradido/*.proto if [ ! -d "./src/cpp/proto/hedera" ] ; then mkdir ./src/cpp/proto/hedera fi -protoc --cpp_out=./src/cpp/proto/hedera --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto +./protoc --plugin=protoc-gen-grpc=./grpc_cpp_plugin.exe --cpp_out=./src/cpp/proto/hedera --grpc_out=./src/cpp/proto/hedera --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto +