mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
added shared library
This commit is contained in:
parent
083ebbefe3
commit
d060017805
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required (VERSION 2.8)
|
cmake_minimum_required (VERSION 3.0)
|
||||||
project(fuse-wsfs)
|
project(fuse-wsfs VERSION 0.1.0 DESCRIPTION "Websocket filesystem based on libfuse")
|
||||||
|
|
||||||
option(WITH_TESTS "enable unit tests" OFF)
|
option(WITH_TESTS "enable unit tests" OFF)
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ set(EXTRA_CFLAGS
|
|||||||
|
|
||||||
# libfuse-wsfs
|
# libfuse-wsfs
|
||||||
|
|
||||||
add_library(fuse-wsfs
|
set(FUSE_WSFS_SOURCES
|
||||||
src/wsfs/status.c
|
src/wsfs/status.c
|
||||||
src/wsfs/filesystem.c
|
src/wsfs/filesystem.c
|
||||||
src/wsfs/server.c
|
src/wsfs/server.c
|
||||||
@ -62,9 +62,24 @@ add_library(fuse-wsfs
|
|||||||
src/wsfs/jsonrpc/util.c
|
src/wsfs/jsonrpc/util.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_library(fuse-wsfs SHARED ${FUSE_WSFS_SOURCES})
|
||||||
|
|
||||||
|
set_target_properties(fuse-wsfs PROPERTIES VERSION ${PROJECT_VERSION})
|
||||||
|
set_target_properties(fuse-wsfs PROPERTIES SOVERSION 0)
|
||||||
|
set_target_properties(fuse-wsfs PROPERTIES C_VISIBILITY_PRESET hidden)
|
||||||
|
set_target_properties(fuse-wsfs PROPERTIES COMPILE_DEFINITIONS "WSFS_API=WSFS_EXPORT")
|
||||||
|
|
||||||
target_include_directories(fuse-wsfs PUBLIC src ${EXTRA_INCLUDE_DIRS})
|
target_include_directories(fuse-wsfs PUBLIC src ${EXTRA_INCLUDE_DIRS})
|
||||||
target_compile_options(fuse-wsfs PUBLIC ${EXTRA_CFLAGS})
|
target_compile_options(fuse-wsfs PUBLIC ${EXTRA_CFLAGS})
|
||||||
|
|
||||||
|
add_library(fuse-wsfs-static STATIC ${FUSE_WSFS_SOURCES})
|
||||||
|
|
||||||
|
set_target_properties(fuse-wsfs-static PROPERTIES OUTPUT_NAME fuse-wsfs)
|
||||||
|
|
||||||
|
target_include_directories(fuse-wsfs-static PUBLIC src ${EXTRA_INCLUDE_DIRS})
|
||||||
|
target_compile_options(fuse-wsfs-static PUBLIC ${EXTRA_CFLAGS})
|
||||||
|
|
||||||
|
|
||||||
# app
|
# app
|
||||||
|
|
||||||
add_executable(wsfs
|
add_executable(wsfs
|
||||||
@ -88,7 +103,7 @@ add_executable(alltests
|
|||||||
test-src/test_timer.cc
|
test-src/test_timer.cc
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(alltests PUBLIC fuse-wsfs ${EXTRA_LIBS} ${GTEST_LIBRARIES})
|
target_link_libraries(alltests PUBLIC fuse-wsfs-static ${EXTRA_LIBS} ${GTEST_LIBRARIES})
|
||||||
target_include_directories(alltests PUBLIC src ${EXTRA_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS})
|
target_include_directories(alltests PUBLIC src ${EXTRA_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS})
|
||||||
target_compile_options(alltests PUBLIC ${EXTRA_CFLAGS} ${GTEST_CFLAGS})
|
target_compile_options(alltests PUBLIC ${EXTRA_CFLAGS} ${GTEST_CFLAGS})
|
||||||
|
|
||||||
|
@ -3,5 +3,7 @@
|
|||||||
|
|
||||||
#include "wsfs/api.h"
|
#include "wsfs/api.h"
|
||||||
#include "wsfs/server.h"
|
#include "wsfs/server.h"
|
||||||
|
#include "wsfs/server_config.h"
|
||||||
|
#include "wsfs/server_protocol.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,4 +5,12 @@
|
|||||||
#define WSFS_API
|
#define WSFS_API
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WSFS_EXPORT
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define WSFS_EXPORT __attribute__ ((visibility ("default")))
|
||||||
|
#else
|
||||||
|
#define WSFS_EXPORT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user