Commit 7b483bc1 authored by Giorgio Azzinnaro's avatar Giorgio Azzinnaro

boost version in cmake

parent 9fef1559
add_definitions(-DBOOST_LOG_DYN_LINK) # This is for the Boost Log library to load the proper target namespace for the current platform
find_package(Boost REQUIRED COMPONENTS log filesystem) # Boost Filesystem scans the .proto directory
find_package(Boost 1.54
REQUIRED
COMPONENTS log filesystem) # Boost Filesystem scans the .proto directory
add_library(profanedb_format STATIC protobuf/marshaller.cpp protobuf/loader.cpp)
target_link_libraries(profanedb_format profanedb_protobuf ${Boost_LIBRARIES})
......
......@@ -37,9 +37,6 @@ public:
// Turn a stored message back into the original format
virtual const Message & Unmarshal(const profanedb::protobuf::StorableMessage & storable) = 0;
// Retrieve the Key from the given Message
virtual const profanedb::protobuf::Key & GetKey(const Message & message) = 0;
};
}
}
......
......@@ -158,13 +158,6 @@ const Message & Marshaller::Unmarshal(const StorableMessage & storable)
return *originalMessage;
}
// TODO Get Key from Loader without iteration
const Key & Marshaller::GetKey(const Message & message)
{
Key key;
return key;
}
void Marshaller::CopyMessage(const Message & from, Message * to)
{
std::vector< const FieldDescriptor * > setFields;
......
......@@ -48,9 +48,6 @@ public:
virtual profanedb::protobuf::MessageTreeNode Marshal(const google::protobuf::Message & message) override;
virtual const google::protobuf::Message & Unmarshal(const profanedb::protobuf::StorableMessage & storable) override;
// TODO Instead of iterating through all fields, Loader should give this info
virtual const profanedb::protobuf::Key & GetKey(const google::protobuf::Message & message) override;
private:
// Loader contains the schemaPool and normalizedPool
const std::shared_ptr<Loader> loader;
......
find_package(Threads REQUIRED)
find_package(Protobuf REQUIRED) # Protobuf does the serialisation for the DB
# TODO gRPC and Protobuf should be embedded
# Proto are no longer generated in build,
# but come from https://gitlab.com/ProfaneDB/protobuf
......
find_package(gRPC REQUIRED)
add_definitions(-DBOOST_LOG_DYN_LINK) # This is for the Boost Log library to load the proper target namespace for the current platform
find_package(Boost REQUIRED COMPONENTS log filesystem program_options)
find_package(Boost 1.54
REQUIRED
COMPONENTS log filesystem program_options)
include_directories (${Boost_INCLUDE_DIRS})
add_executable(profanedb_server main.cpp server.cpp config.cpp)
......
find_package(Boost REQUIRED COMPONENTS random)
find_package(Boost 1.15
REQUIRED
COMPONENTS random)
include_directories (${Boost_INCLUDE_DIRS})
add_library(profanedb_util randomgenerator.cpp)
......
......@@ -31,6 +31,7 @@
namespace profanedb {
namespace util {
// RandomGenerator takes care of filling a protobuf message with random data for testing/benchmark purposes
class RandomGenerator
{
public:
......
......@@ -4,7 +4,9 @@ set(PROTOBUF_IMPORT_DIRS ${PROTOBUF_IMPORT_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(schema)
add_definitions(-DBOOST_TEST_DYN_LINK) # This is for Boost Test to use the shared library
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
find_package(Boost 1.21
REQUIRED
COMPONENTS unit_test_framework)
include_directories (${Boost_INCLUDE_DIRS})
file(GLOB Tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.test.cpp")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment