1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

moved message and message_queue to common library

This commit is contained in:
Falk Werner 2019-02-25 21:28:31 +01:00
parent 1976841334
commit af71bcbff3
7 changed files with 18 additions and 10 deletions

View File

@ -17,6 +17,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(C_WARNINGS -Wall -Wextra) set(C_WARNINGS -Wall -Wextra)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(EXTRA_INCLUDE_DIRS set(EXTRA_INCLUDE_DIRS
"include" "include"
@ -40,7 +41,12 @@ set(EXTRA_CFLAGS
${JANSSON_CFLAGS_OTHER} ${JANSSON_CFLAGS_OTHER}
"-pthread" "-pthread"
) )
# libwsfs-common
set(WSFS_COMMON_SOURCES
lib/wsfs/message.c
lib/wsfs/message_queue.c
)
# libwsfs-adapter # libwsfs-adapter
@ -48,8 +54,6 @@ set(WSFS_ADAPTER_SOURCES
lib/wsfs/adapter/status.c lib/wsfs/adapter/status.c
lib/wsfs/adapter/filesystem.c lib/wsfs/adapter/filesystem.c
lib/wsfs/adapter/server.c lib/wsfs/adapter/server.c
lib/wsfs/adapter/message.c
lib/wsfs/adapter/message_queue.c
lib/wsfs/adapter/time/timepoint.c lib/wsfs/adapter/time/timepoint.c
lib/wsfs/adapter/time/timer.c lib/wsfs/adapter/time/timer.c
lib/wsfs/adapter/time/timeout_manager.c lib/wsfs/adapter/time/timeout_manager.c
@ -68,7 +72,7 @@ set(WSFS_ADAPTER_SOURCES
lib/wsfs/adapter/jsonrpc/util.c lib/wsfs/adapter/jsonrpc/util.c
) )
add_library(wsfs-adapter SHARED ${WSFS_ADAPTER_SOURCES}) add_library(wsfs-adapter SHARED ${WSFS_ADAPTER_SOURCES} ${WSFS_COMMON_SOURCES})
set_target_properties(wsfs-adapter PROPERTIES VERSION ${PROJECT_VERSION}) set_target_properties(wsfs-adapter PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(wsfs-adapter PROPERTIES SOVERSION 0) set_target_properties(wsfs-adapter PROPERTIES SOVERSION 0)
@ -80,6 +84,7 @@ target_compile_options(wsfs-adapter PUBLIC ${EXTRA_CFLAGS})
file(WRITE "${PROJECT_BINARY_DIR}/libwsfs-adapter.pc" file(WRITE "${PROJECT_BINARY_DIR}/libwsfs-adapter.pc"
"prefix=\"${CMAKE_INSTALL_PREFIX}\" "prefix=\"${CMAKE_INSTALL_PREFIX}\"
exec_prefix=\${prefix} exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib${LIB_SUFFIX} libdir=\${exec_prefix}/lib${LIB_SUFFIX}
includedir=\${prefix}/include includedir=\${prefix}/include
@ -113,7 +118,7 @@ set(WSFS_PROVIDER_SOURCES
lib/wsfs/provider/operation/read.c lib/wsfs/provider/operation/read.c
) )
add_library(wsfs-provider SHARED ${WSFS_PROVIDER_SOURCES}) add_library(wsfs-provider SHARED ${WSFS_PROVIDER_SOURCES} ${WSFS_COMMON_SOURCES})
set_target_properties(wsfs-provider PROPERTIES VERSION ${PROJECT_VERSION}) set_target_properties(wsfs-provider PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(wsfs-provider PROPERTIES SOVERSION 0) set_target_properties(wsfs-provider PROPERTIES SOVERSION 0)
@ -194,6 +199,7 @@ add_executable(alltests
test/test_timepoint.cc test/test_timepoint.cc
test/test_timer.cc test/test_timer.cc
test/test_url.cc test/test_url.cc
${WSFS_COMMON_SOURCES}
) )
target_link_libraries(alltests PUBLIC wsfs-adapter-static wsfs-provider-static ${EXTRA_LIBS} ${GTEST_LIBRARIES}) target_link_libraries(alltests PUBLIC wsfs-adapter-static wsfs-provider-static ${EXTRA_LIBS} ${GTEST_LIBRARIES})

View File

@ -3,10 +3,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <libwebsockets.h> #include <libwebsockets.h>
#include "wsfs/adapter/message.h" #include "wsfs/message.h"
#include "wsfs/adapter/filesystem.h"
#include "wsfs/util.h" #include "wsfs/util.h"
#include "wsfs/adapter/filesystem.h"
static int wsfs_server_protocol_callback( static int wsfs_server_protocol_callback(
struct lws * wsi, struct lws * wsi,
enum lws_callback_reasons reason, enum lws_callback_reasons reason,

View File

@ -1,9 +1,10 @@
#ifndef WSFS_SERVER_PROTOCOL_INTERN_H #ifndef WSFS_SERVER_PROTOCOL_INTERN_H
#define WSFS_SERVER_PROTOCOL_INTERN_H #define WSFS_SERVER_PROTOCOL_INTERN_H
#include "wsfs/message_queue.h"
#include "wsfs/adapter/server_protocol.h" #include "wsfs/adapter/server_protocol.h"
#include "wsfs/adapter/filesystem.h" #include "wsfs/adapter/filesystem.h"
#include "wsfs/adapter/message_queue.h"
#include "wsfs/adapter/jsonrpc/server.h" #include "wsfs/adapter/jsonrpc/server.h"
#include "wsfs/adapter/time/timeout_manager.h" #include "wsfs/adapter/time/timeout_manager.h"

View File

@ -1,4 +1,4 @@
#include "wsfs/adapter/message.h" #include "wsfs/message.h"
#include <stdlib.h> #include <stdlib.h>
#include <libwebsockets.h> #include <libwebsockets.h>

View File

@ -1,5 +1,5 @@
#include "wsfs/adapter/message_queue.h" #include "wsfs/message_queue.h"
#include "wsfs/adapter/message.h" #include "wsfs/message.h"
void wsfs_message_queue_init( void wsfs_message_queue_init(
struct wsfs_message_queue * queue) struct wsfs_message_queue * queue)