File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
contrib/devtools/bitcoin-tidy Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ else()
25
25
target_compile_options (bitcoin-tidy PRIVATE -fno-exceptions )
26
26
endif ()
27
27
28
+ if (CMAKE_HOST_APPLE )
29
+ # ld64 expects no undefined symbols by default
30
+ target_link_options (bitcoin-tidy PRIVATE -Wl,-flat_namespace )
31
+ target_link_options (bitcoin-tidy PRIVATE -Wl,-undefined -Wl,suppress )
32
+ endif ()
33
+
28
34
# Add warnings
29
35
if (MSVC )
30
36
target_compile_options (bitcoin-tidy PRIVATE /W4 )
@@ -33,7 +39,12 @@ else()
33
39
target_compile_options (bitcoin-tidy PRIVATE -Wextra )
34
40
endif ()
35
41
36
- set (CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE} " "--load=${CMAKE_BINARY_DIR} /${CMAKE_SHARED_LIBRARY_PREFIX} bitcoin-tidy${CMAKE_SHARED_LIBRARY_SUFFIX} " "-checks=-*,bitcoin-*" )
42
+ if (CMAKE_VERSION VERSION_LESS 3.27 )
43
+ set (CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE} " "--load=${CMAKE_BINARY_DIR} /${CMAKE_SHARED_MODULE_PREFIX} bitcoin-tidy${CMAKE_SHARED_MODULE_SUFFIX} " "-checks=-*,bitcoin-*" )
44
+ else ()
45
+ # CLANG_TIDY_COMMAND supports generator expressions as of 3.27
46
+ set (CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE} " "--load=$<TARGET_FILE:bitcoin-tidy>" "-checks=-*,bitcoin-*" )
47
+ endif ()
37
48
38
49
# Create a dummy library that runs clang-tidy tests as a side-effect of building
39
50
add_library (bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_logprintf.cpp )
You can’t perform that action at this time.
0 commit comments