From 83af065acdf95b9ccc6097afbe62654aae09c36c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 2 Jun 2021 12:02:43 +0200 Subject: [PATCH] small updates --- login_server/CMakeLists.txt | 7 ++++--- login_server/scripts/windows_parse_proto.sh | 12 +++--------- login_server/src/cpp/lib/Error.cpp | 6 ++++++ login_server/src/cpp/lib/Error.h | 3 +++ login_server/src/cpp/lib/Notification.cpp | 6 ++++++ login_server/src/cpp/lib/Notification.h | 1 + 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/login_server/CMakeLists.txt b/login_server/CMakeLists.txt index 6818f887d..f6a5445a7 100644 --- a/login_server/CMakeLists.txt +++ b/login_server/CMakeLists.txt @@ -51,8 +51,9 @@ file(MAKE_DIRECTORY ${PROTOBINDING_PATH}/gradido) FILE(GLOB DATAMODEL_GRADIDO_PROTOS "${GRADIDO_PROTO_MODEL_PATH}/gradido/*.proto") IF(WIN32) - find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "build/dependencies/grpc/third_party/protobuf/bin/Debug" ) - find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "build/dependencies/grpc/third_party/protobuf/bin/Release" ) + set(PROTOC_BIN_PATH "build/dependencies/protobuf/cmake/bin") + find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "${PROTOC_BIN_PATH}/Debug" ) + find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "${PROTOC_BIN_PATH}/Release" ) ELSE() find_program(PROTOBUF_PROTOC_EXECUTABLE protoc PATHS "build/dependencies/protobuf/cmake/bin" ) ENDIF() @@ -254,7 +255,7 @@ ENDIF() target_link_libraries(Gradido_LoginServer ${GRPC_LIBS}) if(WIN32) - target_link_libraries(Gradido_LoginServer mariadbclient ${CONAN_LIBS}) + target_link_libraries(Gradido_LoginServer mariadbclient libprotobuf ${CONAN_LIBS}) #TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi) #TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi) else() # unix diff --git a/login_server/scripts/windows_parse_proto.sh b/login_server/scripts/windows_parse_proto.sh index b01ae74d7..075cf6fbd 100644 --- a/login_server/scripts/windows_parse_proto.sh +++ b/login_server/scripts/windows_parse_proto.sh @@ -5,15 +5,9 @@ fi if [ ! -d "../src/cpp/proto/gradido" ] ; then mkdir ../src/cpp/proto/gradido fi -PROTOC_PATH=build/bin -CPP_PLUGIN_PATH=build/bin -$PROTOC_PATH/protoc.exe --cpp_out=../src/cpp/proto --proto_path=../src/proto ../src/proto/gradido/*.proto +PROTOC_PATH=../build/dependencies/protobuf/cmake/bin/Debug + +$PROTOC_PATH/protoc.exe --cpp_out=../build/proto/gradido --proto_path=../src/proto ../src/proto/gradido/*.proto -if [ ! -d "./src/cpp/proto/hedera" ] ; then - mkdir ./src/cpp/proto/hedera -fi - -GOOGLE_PROTOBUF_INCLUDES=../dependencies/grpc/third_party/protobuf/src -$PROTOC_PATH/protoc.exe --plugin=protoc-gen-grpc=$CPP_PLUGIN_PATH/grpc_cpp_plugin.exe --cpp_out=../src/cpp/proto/hedera --grpc_out=../src/cpp/proto/hedera --proto_path=$GOOGLE_PROTOBUF_INCLUDES --proto_path=../src/proto/hedera/hedera-protobuf/src/main/proto ../src/proto/hedera/hedera-protobuf/src/main/proto/*.proto diff --git a/login_server/src/cpp/lib/Error.cpp b/login_server/src/cpp/lib/Error.cpp index 9897d7930..a341c4466 100644 --- a/login_server/src/cpp/lib/Error.cpp +++ b/login_server/src/cpp/lib/Error.cpp @@ -7,6 +7,12 @@ Error::Error(const char* functionName, const char* message) } +Error::Error(const char* functionName, const std::string& message) + : Notification(functionName, message) +{ + +} + Error::~Error() { diff --git a/login_server/src/cpp/lib/Error.h b/login_server/src/cpp/lib/Error.h index 34199034f..0994d3ae5 100644 --- a/login_server/src/cpp/lib/Error.h +++ b/login_server/src/cpp/lib/Error.h @@ -19,6 +19,7 @@ class Error : public Notification { public: Error(const char* functionName, const char* message); + Error(const char* functionName, const std::string& message); ~Error(); const char* getFunctionName() { return mFunctionName.data(); } @@ -39,6 +40,8 @@ public: : Error(functionName, message), mParam(param) {} ParamError(const char* functionName, const char* message, const std::string& param) : Error(functionName, message), mParam(param) {} + ParamError(const char* functionName, const std::string& message, const std::string& param) + : Error(functionName, message), mParam(param) {} ParamError(const char* functioName, const char* message, int param) : Error(functioName, message) { diff --git a/login_server/src/cpp/lib/Notification.cpp b/login_server/src/cpp/lib/Notification.cpp index 15d622923..f2fb628d1 100644 --- a/login_server/src/cpp/lib/Notification.cpp +++ b/login_server/src/cpp/lib/Notification.cpp @@ -4,4 +4,10 @@ Notification::Notification(const char* functionName, const char* message) : mFunctionName(functionName), mMessage(message) { +} + +Notification::Notification(const char* functionName, const std::string& message) + : mFunctionName(functionName), mMessage(message) +{ + } \ No newline at end of file diff --git a/login_server/src/cpp/lib/Notification.h b/login_server/src/cpp/lib/Notification.h index 419b861bc..39a712aa6 100644 --- a/login_server/src/cpp/lib/Notification.h +++ b/login_server/src/cpp/lib/Notification.h @@ -7,6 +7,7 @@ class Notification { public: Notification(const char* functionName, const char* message); + Notification(const char* functionName, const std::string& message); const char* getFunctionName() { return mFunctionName.data(); } const char* getMessage() { return mMessage.data(); }