Skip to content

Commit 28fbaf6

Browse files
committed
Updated with the pre-commit hook
beman_install_library is however unknown for now. Signed-off-by: Ted Lyngmo <[email protected]>
1 parent 15b5bbc commit 28fbaf6

File tree

6 files changed

+32
-14
lines changed

6 files changed

+32
-14
lines changed

examples/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ message("Examples to be built: ${ALL_EXAMPLES}")
66

77
foreach(example ${ALL_EXAMPLES})
88
add_executable(beman.timed_lock_alg.examples.${example})
9-
target_sources(beman.timed_lock_alg.examples.${example} PRIVATE ${example}.cpp)
9+
target_sources(
10+
beman.timed_lock_alg.examples.${example}
11+
PRIVATE ${example}.cpp
12+
)
1013
target_link_libraries(
1114
beman.timed_lock_alg.examples.${example}
1215
PRIVATE beman::timed_lock_alg

examples/try_lock_a_bunch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#include <beman/timed_lock_alg/mutex.hpp>
2-
31
/*
42
* A simple example with 30 timed mutexes where one is locked
53
* for 40 milliseconds before being released.
64
*/
75

6+
#include <beman/timed_lock_alg/mutex.hpp>
7+
88
#include <chrono>
99
#include <iostream>
1010
#include <thread>

include/beman/timed_lock_alg/mutex.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33

44
#include <array>
55
#include <chrono>
6+
#include <concepts>
67
#include <cstddef>
78
#include <mutex>
89
#include <thread>
910
#include <tuple>
1011
#include <utility>
1112

12-
#include <chrono>
13-
#include <concepts>
14-
1513
namespace beman::timed_lock_alg::detail {
1614
template <class T>
1715
concept BasicLockable = requires(T t) {

infra/cmake/use-fetch-content.cmake

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ if(NOT BEMAN_TIMED_LOCK_ALG_LOCKFILE)
1111
endif()
1212

1313
set(BemanTimedLockAlg_projectDir "${CMAKE_CURRENT_LIST_DIR}/../..")
14-
message(TRACE "BemanTimedLockAlg_projectDir=\"${BemanTimedLockAlg_projectDir}\"")
14+
message(
15+
TRACE
16+
"BemanTimedLockAlg_projectDir=\"${BemanTimedLockAlg_projectDir}\""
17+
)
1518

16-
message(TRACE "BEMAN_TIMED_LOCK_ALG_LOCKFILE=\"${BEMAN_TIMED_LOCK_ALG_LOCKFILE}\"")
19+
message(
20+
TRACE
21+
"BEMAN_TIMED_LOCK_ALG_LOCKFILE=\"${BEMAN_TIMED_LOCK_ALG_LOCKFILE}\""
22+
)
1723
file(
1824
REAL_PATH
1925
"${BEMAN_TIMED_LOCK_ALG_LOCKFILE}"
@@ -45,7 +51,10 @@ function(BemanTimedLockAlg_provideDependency method package_name)
4551
"dependencies"
4652
)
4753
if(BemanTimedLockAlg_error)
48-
message(FATAL_ERROR "${BemanTimedLockAlg_lockfile}: ${BemanTimedLockAlg_error}")
54+
message(
55+
FATAL_ERROR
56+
"${BemanTimedLockAlg_lockfile}: ${BemanTimedLockAlg_error}"
57+
)
4958
endif()
5059

5160
# Get the length of the libraries array and store it in BemanTimedLockAlg_dependenciesObj
@@ -56,15 +65,22 @@ function(BemanTimedLockAlg_provideDependency method package_name)
5665
LENGTH "${BemanTimedLockAlg_dependenciesObj}"
5766
)
5867
if(BemanTimedLockAlg_error)
59-
message(FATAL_ERROR "${BemanTimedLockAlg_lockfile}: ${BemanTimedLockAlg_error}")
68+
message(
69+
FATAL_ERROR
70+
"${BemanTimedLockAlg_lockfile}: ${BemanTimedLockAlg_error}"
71+
)
6072
endif()
6173

6274
if(BemanTimedLockAlg_numDependencies EQUAL 0)
6375
return()
6476
endif()
6577

6678
# Loop over each dependency object
67-
math(EXPR BemanTimedLockAlg_maxIndex "${BemanTimedLockAlg_numDependencies} - 1")
79+
math(
80+
EXPR
81+
BemanTimedLockAlg_maxIndex
82+
"${BemanTimedLockAlg_numDependencies} - 1"
83+
)
6884
foreach(BemanTimedLockAlg_index RANGE "${BemanTimedLockAlg_maxIndex}")
6985
set(BemanTimedLockAlg_errorPrefix
7086
"${BemanTimedLockAlg_lockfile}, dependency ${BemanTimedLockAlg_index}"

src/beman/timed_lock_alg/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ target_sources(
1414
"${CMAKE_CURRENT_SOURCE_DIR}/../../../include/beman/timed_lock_alg/mutex.hpp"
1515
)
1616

17-
set_target_properties(beman.timed_lock_alg PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)
17+
set_target_properties(
18+
beman.timed_lock_alg
19+
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON
20+
)
1821

1922
find_package(beman-install-library REQUIRED)
2023
beman_install_library(beman.timed_lock_alg)

tests/beman/timed_lock_alg/mutex.test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
#include <array>
88
#include <chrono>
9-
// #include <execution> // tbb or similar required
109
#include <functional>
1110
#include <future>
12-
#include <mutex>
1311
#include <tuple>
1412

1513
using namespace std::chrono_literals;

0 commit comments

Comments
 (0)