From b861de29176891657cc96631ddbfb4ea9e114a42 Mon Sep 17 00:00:00 2001 From: Fu Juntang <StrongTiger_001@163.com> Date: 星期一, 30 八月 2021 17:52:23 +0800 Subject: [PATCH] re-structure the communication work flow. --- src/CMakeLists.txt | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 61fbc17..eb3f4c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,9 @@ # to the source code configure_file(bus_config.h.in bus_config.h) +#set_property(TARGET shm_queue PROPERTY POSITION_INDEPENDENT_CODE ON) +add_compile_options(-fPIC) +#target_compile_options(shm_queue PRIVATE -fPIC) list(APPEND _SOURCES_ ./logger_factory.cpp @@ -16,31 +19,33 @@ ./bus_error.cpp ./futex_sem.cpp ./svsem.cpp +./bh_api.cpp ./net/net_conn_pool.cpp ./net/net_mod_server_socket_wrapper.cpp ./net/net_mod_socket_wrapper.cpp ./net/net_mod_socket.cpp ./net/net_mod_socket_io.cpp ./net/net_mod_server_socket.cpp +./proto/bhome_msg_api.pb.cc +./proto/bhome_msg.pb.cc +./proto/error_msg.pb.cc ./shm/shm_mm_wrapper.cpp ./shm/mm.cpp ./shm/hashtable.cpp ./shm/shm_mm.cpp -./bh_api.cc -./proto/bhome_msg.pb.cc -./proto/bhome_msg_api.pb.cc -./proto/error_msg.pb.cc ) if (BUILD_SHARED_LIBS) add_library(shm_queue SHARED ${_SOURCES_}) + target_compile_options(shm_queue PRIVATE -fPIC) + set_property(TARGET shm_queue PROPERTY POSITION_INDEPENDENT_CODE ON) else() add_library(shm_queue STATIC ${_SOURCES_}) endif() # STATIC SHARED -# add_library(shm_queue ${_SOURCES_}) +#add_library(shm_queue ${_SOURCES_}) target_include_directories(shm_queue PUBLIC ${EXTRA_INCLUDES} ) @@ -48,11 +53,14 @@ ${PROJECT_BINARY_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/shm + ${CMAKE_CURRENT_SOURCE_DIR}/proto ${CMAKE_CURRENT_SOURCE_DIR}/queue ${CMAKE_CURRENT_SOURCE_DIR}/socket ${CMAKE_CURRENT_SOURCE_DIR}/net ) +add_executable(bus_proxy_start bus_proxy_start.cpp) +target_link_libraries(bus_proxy_start PRIVATE shm_queue ${EXTRA_LIBS} ) target_link_libraries(shm_queue PUBLIC ${EXTRA_LIBS} ) @@ -74,6 +82,7 @@ ./bus_def.h ./logger_factory.h ./sole.h +./proc_def.h ./queue/linked_lock_free_queue.h ./queue/array_lock_free_queue.h ./queue/shm_queue.h @@ -91,7 +100,6 @@ ./shm/shm_mm_wrapper.h ./shm/shm_allocator.h ./shm/shm_mm.h -./bh_api.h DESTINATION include) -- Gitblit v1.8.0