diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a667e36fa..3ded717107 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_C_VISIBILITY_PRESET hidden) +set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) set(CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS TRUE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) diff --git a/Makefile b/Makefile index f364ed00e9..32a7b872a1 100644 --- a/Makefile +++ b/Makefile @@ -157,17 +157,15 @@ shell: # Clang-related tools and checks -clangd: - $(call config-cmake-release, -DCMAKE_EXPORT_COMPILE_COMMANDS=1) # Must build the java native header to avoid missing includes. Pipe character # `|` ensures these targets build in this order, even in the presence of # parallelism. -tidy: | allconfig clangd java_native_header +tidy: | allconfig java_native_header run-clang-tidy -p build/release -quiet -j $(NUM_THREADS) \ "^$(realpath src)|$(realpath tools)/(?!shell/linenoise.cpp)|$(realpath examples)" -clangd-diagnostics: | allconfig clangd java_native_header +clangd-diagnostics: | allconfig java_native_header find src -name *.h -or -name *.cpp | xargs \ ./scripts/get-clangd-diagnostics.py --compile-commands-dir build/release \ -j $(NUM_THREADS) --instances $(CLANGD_DIAGNOSTIC_INSTANCES)