diff options
author | Manuel Bentele | 2020-10-16 17:15:49 +0200 |
---|---|---|
committer | Manuel Bentele | 2020-10-16 17:15:49 +0200 |
commit | 969496f15e1e0359e26c2c6e995ad4ef82720f86 (patch) | |
tree | 358466216630eb10e8ee91b9ede490424f6db848 /src/fuse | |
parent | [FUSE] turn on compiler optimization to fix warning (diff) | |
download | dnbd3-969496f15e1e0359e26c2c6e995ad4ef82720f86.tar.gz dnbd3-969496f15e1e0359e26c2c6e995ad4ef82720f86.tar.xz dnbd3-969496f15e1e0359e26c2c6e995ad4ef82720f86.zip |
[BUILD] rewrite CMake build system to track changes of source files
This change restructures the source code directories, separates shared
form non-shared application code and adds CMake dependencies. These
dependencies allow the tracking of changes and trigger a rebuild of
those build targets where changed files are involved.
WARNING: Note that the support of the DNBD3_SERVER_AFL build option is
not supported yet. Thus, the option should be never turned on.
Diffstat (limited to 'src/fuse')
-rw-r--r-- | src/fuse/CMakeLists.txt | 14 | ||||
-rw-r--r-- | src/fuse/connection.c | 10 | ||||
-rw-r--r-- | src/fuse/connection.h | 4 | ||||
-rw-r--r-- | src/fuse/helper.h | 2 | ||||
-rw-r--r-- | src/fuse/main.c | 10 | ||||
-rw-r--r-- | src/fuse/serialize.c | 5 |
6 files changed, 28 insertions, 17 deletions
diff --git a/src/fuse/CMakeLists.txt b/src/fuse/CMakeLists.txt new file mode 100644 index 0000000..367356a --- /dev/null +++ b/src/fuse/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.10) + +# set the project name +project(dnbd3-fuse) + +# add compile option to enable enhanced POSIX pthread features +add_compile_options(-D_GNU_SOURCE) + +add_executable(dnbd3-fuse ${CMAKE_CURRENT_SOURCE_DIR}/connection.c + ${CMAKE_CURRENT_SOURCE_DIR}/helper.c + ${CMAKE_CURRENT_SOURCE_DIR}/main.c) +target_include_directories(dnbd3-fuse PRIVATE ${FUSE_INCLUDE_DIRS}) +target_link_libraries(dnbd3-fuse dnbd3-version dnbd3-shared ${FUSE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +install(TARGETS dnbd3-fuse RUNTIME DESTINATION bin) diff --git a/src/fuse/connection.c b/src/fuse/connection.c index 7bd8018..25ea219 100644 --- a/src/fuse/connection.c +++ b/src/fuse/connection.c @@ -1,10 +1,10 @@ #include "connection.h" #include "helper.h" -#include "../clientconfig.h" -#include "../shared/protocol.h" -#include "../shared/fdsignal.h" -#include "../shared/sockhelper.h" -#include "../shared/log.h" +#include <dnbd3/config/client.h> +#include <dnbd3/shared/protocol.h> +#include <dnbd3/shared/fdsignal.h> +#include <dnbd3/shared/sockhelper.h> +#include <dnbd3/shared/log.h> #include <stdlib.h> #include <pthread.h> diff --git a/src/fuse/connection.h b/src/fuse/connection.h index be0115e..dde6da9 100644 --- a/src/fuse/connection.h +++ b/src/fuse/connection.h @@ -1,8 +1,8 @@ #ifndef _CONNECTION_H_ #define _CONNECTION_H_ -#include "../shared/fdsignal.h" -#include "../shared/timing.h" +#include <dnbd3/shared/fdsignal.h> +#include <dnbd3/shared/timing.h> #include <stdatomic.h> #include <stddef.h> #include <stdbool.h> diff --git a/src/fuse/helper.h b/src/fuse/helper.h index 65cca2c..b1fa513 100644 --- a/src/fuse/helper.h +++ b/src/fuse/helper.h @@ -1,7 +1,7 @@ #ifndef IMAGEHELPER_H #define IMAGEHELPER_H -#include "../types.h" +#include <dnbd3/types.h> #include <netdb.h> #include <stdbool.h> diff --git a/src/fuse/main.c b/src/fuse/main.c index f303c9c..cf9efbe 100644 --- a/src/fuse/main.c +++ b/src/fuse/main.c @@ -10,11 +10,12 @@ #include "connection.h" #include "helper.h" -#include "../shared/protocol.h" -#include "../shared/log.h" +#include <dnbd3/version.h> +#include <dnbd3/shared/protocol.h> +#include <dnbd3/shared/log.h> #define FUSE_USE_VERSION 30 -#include "../config.h" +#include <dnbd3/config.h> #include <fuse_lowlevel.h> #include <stdio.h> #include <stdlib.h> @@ -272,7 +273,8 @@ static struct fuse_lowlevel_ops image_oper = { static void printVersion() { char *arg[] = { "foo", "-V" }; - printf( "DNBD3-Fuse Version 1.2.3.4, protocol version %d\n", (int)PROTOCOL_VERSION ); + printf( "dnbd3-fuse version: %s\n", DNBD3_VERSION ); + printf( "Protocol version: %d\n", (int)PROTOCOL_VERSION ); struct fuse_args args = FUSE_ARGS_INIT( 2, arg ); fuse_parse_cmdline( &args, NULL, NULL, NULL ); exit( 0 ); diff --git a/src/fuse/serialize.c b/src/fuse/serialize.c deleted file mode 100644 index 4934132..0000000 --- a/src/fuse/serialize.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdint.h> - -#include "../serialize.c" |