From 866b4faedb8ffcc91edc65412ba3fe829fe159f0 Mon Sep 17 00:00:00 2001 From: Dario Date: Fri, 20 Sep 2019 11:17:00 +0200 Subject: [PATCH] gradido login server, first config and code --- .gitmodules | 6 ++++++ CMakeLists.txt | 38 ++++++++++++++++++++++++++++++++++++++ conanfile.txt | 8 ++++++++ dependencies/iroha-ed25519 | 1 + dependencies/tinf | 1 + src/cpp/ServerConfig.cpp | 0 src/cpp/ServerConfig.h | 0 src/cpp/main.cpp | 16 ++++++++++++++++ 8 files changed, 70 insertions(+) create mode 100644 .gitmodules create mode 100644 CMakeLists.txt create mode 100644 conanfile.txt create mode 160000 dependencies/iroha-ed25519 create mode 160000 dependencies/tinf create mode 100644 src/cpp/ServerConfig.cpp create mode 100644 src/cpp/ServerConfig.h create mode 100644 src/cpp/main.cpp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..86ae71f8c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "dependencies/tinf"] + path = dependencies/tinf + url = https://github.com/jibsen/tinf.git +[submodule "dependencies/iroha-ed25519"] + path = dependencies/iroha-ed25519 + url = https://github.com/hyperledger/iroha-ed25519.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..53f155600 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.0) +project(Gradido_LoginServer C CXX) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin" ) + +add_definitions("-std=c++11") + +include_directories( + "dependencies" + "dependencies/tinf/src/" + "dependencies/iroha-ed25519/include" +) + +FILE(GLOB TINF "dependencies/tinf/src/*.c" "dependencies/tinf/src/*.h") +SET(LOCAL_SRCS ${TINF}) +aux_source_directory("src/cpp" LOCAL_SRCS) + +if(MSVC) +# src +source_group("tinf" FILES ${TINF}) + +endif(MSVC) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + + + +add_executable(Gradido_LoginServer ${LOCAL_SRCS}) + +if(WIN32) + +find_library(IROHA_ED25519 ed25519 PATHS "dependencies/iroha-ed25519/build/Debug" REQUIRED) + +else(WIN32) + +endif(WIN32) + +target_link_libraries(Gradido_LoginServer ${CONAN_LIBS} ${IROHA_ED25519}) \ No newline at end of file diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 000000000..6ff2f4318 --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,8 @@ +[requires] +Poco/1.9.4@pocoproject/stable +libsodium/1.0.18@bincrafters/stable +protobuf/3.9.1@bincrafters/stable + + +[generators] +cmake diff --git a/dependencies/iroha-ed25519 b/dependencies/iroha-ed25519 new file mode 160000 index 000000000..eb4c0fce9 --- /dev/null +++ b/dependencies/iroha-ed25519 @@ -0,0 +1 @@ +Subproject commit eb4c0fce900e2468b94bb9e9498af626bb66c039 diff --git a/dependencies/tinf b/dependencies/tinf new file mode 160000 index 000000000..9929246b8 --- /dev/null +++ b/dependencies/tinf @@ -0,0 +1 @@ +Subproject commit 9929246b87f0946b124cfa2a89894b8943b0b072 diff --git a/src/cpp/ServerConfig.cpp b/src/cpp/ServerConfig.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/ServerConfig.h b/src/cpp/ServerConfig.h new file mode 100644 index 000000000..e69de29bb diff --git a/src/cpp/main.cpp b/src/cpp/main.cpp new file mode 100644 index 000000000..f279c7bd6 --- /dev/null +++ b/src/cpp/main.cpp @@ -0,0 +1,16 @@ +#include +#include + + +int main(int argc, char* argv[]) { + printf("hallo Welt\n"); + + if (sodium_init() < 0) { + /* panic! the library couldn't be initialized, it is not safe to use */ + } + else { + printf("sodium initalized\n"); + } + + return 42; +} \ No newline at end of file