summaryrefslogtreecommitdiffstats
path: root/src/bench
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/bench
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/bench')
-rw-r--r--src/bench/CMakeLists.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bench/CMakeLists.txt b/src/bench/CMakeLists.txt
index 4e2becf..24542a7 100644
--- a/src/bench/CMakeLists.txt
+++ b/src/bench/CMakeLists.txt
@@ -7,9 +7,16 @@ project(dnbd3-bench
# add compile option to enable enhanced POSIX pthread features
add_definitions(-D_GNU_SOURCE)
-add_executable(dnbd3-bench ${CMAKE_CURRENT_SOURCE_DIR}/connection.c
- ${CMAKE_CURRENT_SOURCE_DIR}/helper.c
- ${CMAKE_CURRENT_SOURCE_DIR}/main.c)
+set(DNBD3_BENCH_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/connection.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/helper.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/main.c)
+set(DNBD3_BENCH_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/connection.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/helper.h)
+
+add_executable(dnbd3-bench ${DNBD3_BENCH_SOURCE_FILES})
target_link_libraries(dnbd3-bench dnbd3-version dnbd3-shared ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS dnbd3-bench RUNTIME DESTINATION bin
COMPONENT bench)
+
+add_linter(dnbd3-bench-lint "${DNBD3_BENCH_SOURCE_FILES}" "${DNBD3_BENCH_HEADER_FILES}")
+add_linter_fix(dnbd3-bench-lint-fix "${DNBD3_BENCH_SOURCE_FILES}" "${DNBD3_BENCH_HEADER_FILES}")