Skip to content

Commit d4bc563

Browse files
ryanofskyhebasto
andcommitted
cmake: Fix clang-tidy "no input files" errors
This change is technically not needed to add libmultiprocess as a subtree, but it avoids a CI failure in followup PR #30975 which enables multiprocess build option in more CI jobs. In that PR, clang-tidy job fails due to missing generated example files as reported bitcoin/bitcoin#30975 (comment) Different fixes were suggested bitcoin/bitcoin#30975 (comment) and bitcoin/bitcoin#30975 (comment) Co-authored-by: Hennadii Stepanov <[email protected]>
1 parent abdf3cb commit d4bc563

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/libmultiprocess.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@ function(add_libmultiprocess subdir)
2929
# Add tests to "all" target so ctest can run them
3030
set_target_properties(mptests PROPERTIES EXCLUDE_FROM_ALL OFF)
3131
endif()
32+
# Exclude examples from compilation database, because the examples are not
33+
# built by default, and they contain generated c++ code. Without this
34+
# exclusion, tools like clang-tidy and IWYU that make use of compilation
35+
# database would complain that the generated c++ source files do not exist. An
36+
# alternate fix could build "mpexamples" by default like "mptests" above.
37+
set_target_properties(mpcalculator mpprinter mpexample PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
3238
endfunction()

0 commit comments

Comments
 (0)