summaryrefslogtreecommitdiffstats
path: root/src/shared
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/shared
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/shared')
-rw-r--r--src/shared/CMakeLists.txt20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt
index 6356399..b280b77 100644
--- a/src/shared/CMakeLists.txt
+++ b/src/shared/CMakeLists.txt
@@ -7,10 +7,18 @@ project(dnbd3-shared
# add compile option to get POLLRDHUP support for signals
add_definitions(-D_GNU_SOURCE)
-add_library(dnbd3-shared STATIC ${CMAKE_CURRENT_SOURCE_DIR}/crc32.c
- ${CMAKE_CURRENT_SOURCE_DIR}/fdsignal.c
- ${CMAKE_CURRENT_SOURCE_DIR}/log.c
- ${CMAKE_CURRENT_SOURCE_DIR}/serialize.c
- ${CMAKE_CURRENT_SOURCE_DIR}/sockhelper.c
- ${CMAKE_CURRENT_SOURCE_DIR}/timing.c)
+set(DNBD3_SHARED_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/crc32.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/fdsignal.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/log.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/serialize.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/sockhelper.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/timing.c)
+set(DNBD3_SHARED_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/fdsignal.inc/eventfd.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/fdsignal.inc/pipe64.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/fdsignal.inc/pipe_malloc.c)
+
+add_library(dnbd3-shared STATIC ${DNBD3_SHARED_SOURCE_FILES})
target_include_directories(dnbd3-shared PUBLIC ${PROJECT_INCLUDE_DIR})
+
+add_linter(dnbd3-shared-lint "${DNBD3_SHARED_SOURCE_FILES}" "${DNBD3_SHARED_HEADER_FILES}")
+add_linter_fix(dnbd3-shared-lint-fix "${DNBD3_SHARED_SOURCE_FILES}" "${DNBD3_SHARED_HEADER_FILES}")