refactor things, build mesytec-node-nng lib
This commit is contained in:
parent
567a999fdc
commit
e25f76eebf
10 changed files with 29 additions and 19 deletions
|
@ -1,6 +1,11 @@
|
|||
cmake_minimum_required(VERSION 3.14)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(mvlc-nng-node)
|
||||
project(mesytec-node LANGUAGES CXX)
|
||||
|
||||
set(MESYTEC_NODE_MAIN_PROJECT OFF)
|
||||
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
set(MESYTEC_NODE_MAIN_PROJECT ON)
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
## Create binaries in the root of the build directory
|
||||
|
|
2
external/mesytec-mvlc
vendored
2
external/mesytec-mvlc
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 06b7bd33859d84ef77871c54500aeb325090ac64
|
||||
Subproject commit 8e883f6747b864173d7821956ca4ef22ea2607d1
|
|
@ -12,7 +12,6 @@
|
|||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <optional>
|
||||
#include "thread_name.h"
|
||||
|
||||
namespace mesytec::nng
|
||||
{
|
|
@ -20,50 +20,54 @@ set(MVLC_NNG_NODE_WARN_FLAGS -Wall -Wextra -Wpedantic)
|
|||
#)
|
||||
#target_include_directories(dp_common INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(mesytec-node-nng mesytec_node_nng.cc)
|
||||
target_include_directories(mesytec-node-nng PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
|
||||
target_link_libraries(mesytec-node-nng PUBLIC mesytec-mvlc PUBLIC nng)
|
||||
target_compile_features(mesytec-node-nng PUBLIC cxx_std_17)
|
||||
|
||||
add_executable(pair_producer pair_producer.cc)
|
||||
target_compile_features(pair_producer PRIVATE cxx_std_17)
|
||||
target_link_libraries(pair_producer PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(pair_producer PRIVATE mesytec-node-nng)
|
||||
target_compile_options(pair_producer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(pair_consumer pair_consumer.cc)
|
||||
target_compile_features(pair_consumer PRIVATE cxx_std_17)
|
||||
target_link_libraries(pair_consumer PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(pair_consumer PRIVATE mesytec-node-nng)
|
||||
target_compile_options(pair_consumer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(pair_inproc pair_inproc.cc)
|
||||
target_compile_features(pair_inproc PRIVATE cxx_std_17)
|
||||
target_link_libraries(pair_inproc PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(pair_inproc PRIVATE mesytec-node-nng)
|
||||
target_compile_options(pair_inproc PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(mvlc_nng_replay mvlc_nng_replay.cc)
|
||||
target_compile_features(mvlc_nng_replay PRIVATE cxx_std_17)
|
||||
target_link_libraries(mvlc_nng_replay PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(mvlc_nng_replay PRIVATE mesytec-node-nng)
|
||||
target_compile_options(mvlc_nng_replay PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(mesy_nng_pipeline_main mesy_nng_pipeline_main.cc)
|
||||
target_compile_features(mesy_nng_pipeline_main PRIVATE cxx_std_17)
|
||||
target_link_libraries(mesy_nng_pipeline_main PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(mesy_nng_pipeline_main PRIVATE mesytec-node-nng)
|
||||
target_compile_options(mesy_nng_pipeline_main PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(mesy_nng_push_pull_main mesy_nng_push_pull_main.cc)
|
||||
target_compile_features(mesy_nng_push_pull_main PRIVATE cxx_std_17)
|
||||
target_link_libraries(mesy_nng_push_pull_main PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(mesy_nng_push_pull_main PRIVATE mesytec-node-nng)
|
||||
target_compile_options(mesy_nng_push_pull_main PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(mesy_nng_pub_producer pub_producer.cc)
|
||||
target_compile_features(mesy_nng_pub_producer PRIVATE cxx_std_17)
|
||||
target_link_libraries(mesy_nng_pub_producer PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(mesy_nng_pub_producer PRIVATE mesytec-node-nng)
|
||||
target_compile_options(mesy_nng_pub_producer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(mesy_nng_sub_consumer sub_consumer.cc)
|
||||
target_compile_features(mesy_nng_sub_consumer PRIVATE cxx_std_17)
|
||||
target_link_libraries(mesy_nng_sub_consumer PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(mesy_nng_sub_consumer PRIVATE mesytec-node-nng)
|
||||
target_compile_options(mesy_nng_sub_consumer PRIVATE ${MVLC_NNG_NODE_WARN_FLAGS})
|
||||
|
||||
add_executable(mnode-proto-test1 mnode_proto_test1.cc thread_name.cc)
|
||||
target_link_libraries(mnode-proto-test1 PRIVATE mnode-proto PRIVATE mesytec-mvlc PRIVATE nng)
|
||||
target_link_libraries(mnode-proto-test1 PRIVATE mnode-proto PRIVATE mesytec-node-nng PRIVATE mesytec-mvlc)
|
||||
|
||||
#add_subdirectory(nng)
|
||||
#add_subdirectory(qt)
|
||||
|
||||
#unset(CMAKE_C_CLANG_TIDY)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <future>
|
||||
#include "mesy_nng.h"
|
||||
#include <mesytec-node/mesytec_node_nng.h>
|
||||
|
||||
using namespace mesytec::nng;
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#include "mesy_nng.h"
|
||||
#include <mesytec-node/mesytec_node_nng.h>
|
||||
#include <nng/protocol/pipeline0/push.h>
|
||||
#include <nng/protocol/pipeline0/pull.h>
|
||||
#include <thread>
|
||||
|
||||
#include "test_producer_consumer.h"
|
||||
#include <mesytec-node/mesytec_node_nng.h>
|
||||
|
||||
using namespace mesytec::nng;
|
||||
|
||||
|
|
1
src/mesytec_node_nng.cc
Normal file
1
src/mesytec_node_nng.cc
Normal file
|
@ -0,0 +1 @@
|
|||
#include "mesytec-node/mesytec_node_nng.h"
|
|
@ -1,6 +1,6 @@
|
|||
#include <mesytec-mvlc/mesytec-mvlc.h>
|
||||
#include "proto/service.pb.h"
|
||||
#include "mesy_nng.h"
|
||||
#include <mesytec-node/mesytec_node_nng.h>
|
||||
|
||||
using namespace mesytec;
|
||||
using namespace std::literals;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <mesytec-mvlc/mesytec-mvlc.h>
|
||||
#include <nng/nng.h>
|
||||
#include <sys/prctl.h>
|
||||
#include "mesy_nng.h"
|
||||
#include <mesytec-node/mesytec_node_nng.h>
|
||||
|
||||
using namespace mesytec;
|
||||
using namespace mesytec::mvlc;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef E6EFFE63_EB2C_4573_B723_61840850BBF6
|
||||
#define E6EFFE63_EB2C_4573_B723_61840850BBF6
|
||||
|
||||
#include "mesy_nng.h"
|
||||
#include <mesytec-node/mesytec_node_nng.h>
|
||||
|
||||
using namespace mesytec::nng; // to make the old code compile. for test code only.
|
||||
|
||||
|
|
Loading…
Reference in a new issue