summaryrefslogtreecommitdiffstats
path: root/src/fuse
diff options
context:
space:
mode:
authorManuel Bentele2021-03-04 08:47:43 +0100
committerManuel Bentele2021-03-04 08:47:43 +0100
commit2b5631eaa444023043a18ff3985f5a0e7a11436a (patch)
tree4f27eaf01b80eea60d5f9b65023c8db2635ec8b5 /src/fuse
parent[BUILD] Add build support for Github actions (diff)
downloaddnbd3-2b5631eaa444023043a18ff3985f5a0e7a11436a.tar.gz
dnbd3-2b5631eaa444023043a18ff3985f5a0e7a11436a.tar.xz
dnbd3-2b5631eaa444023043a18ff3985f5a0e7a11436a.zip
[BUILD] Add support in CMake to validate (lint) the source code
Diffstat (limited to 'src/fuse')
-rw-r--r--src/fuse/CMakeLists.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fuse/CMakeLists.txt b/src/fuse/CMakeLists.txt
index fba0ed1..e4c8de9 100644
--- a/src/fuse/CMakeLists.txt
+++ b/src/fuse/CMakeLists.txt
@@ -9,10 +9,17 @@ find_package(Fuse REQUIRED)
# add compile option to enable enhanced POSIX pthread features
add_definitions(-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)
+set(DNBD3_FUSE_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/connection.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/helper.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.c)
+set(DNBD3_FUSE_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/connection.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/helper.h)
+
+add_executable(dnbd3-fuse ${DNBD3_FUSE_SOURCE_FILES})
target_include_directories(dnbd3-fuse PRIVATE ${FUSE_INCLUDE_DIRS})
target_link_libraries(dnbd3-fuse dnbd3-build dnbd3-version dnbd3-shared ${FUSE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS dnbd3-fuse RUNTIME DESTINATION bin
COMPONENT fuse)
+
+add_linter(dnbd3-fuse-lint "${DNBD3_FUSE_SOURCE_FILES}" "${DNBD3_FUSE_HEADER_FILES}")
+add_linter_fix(dnbd3-fuse-lint-fix "${DNBD3_FUSE_SOURCE_FILES}" "${DNBD3_FUSE_HEADER_FILES}")