From 1526337639eb5b0b37fc4447cf1c8c15838dbfe3 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Fri, 26 Jul 2024 15:55:57 -0700 Subject: [PATCH] Add a new option to handle clang-tidy builds. --- CMakeLists.txt | 6 ++++++ scripts/run-clang-tidy.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ad3e15c..cfcae79c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,12 @@ if(${SUBSTRAIT_CPP_BUILD_TESTING}) enable_testing() endif() +if(${CLANG_TIDY_BUILD}) + add_compile_options( + "-Wno-attributes;-Wno-deprecated-declarations" + ) +endif() + install(EXPORT SubstraitTargets DESTINATION lib/cmake/Substrait) add_subdirectory(src/substrait) diff --git a/scripts/run-clang-tidy.sh b/scripts/run-clang-tidy.sh index b7a544d6..358044f0 100755 --- a/scripts/run-clang-tidy.sh +++ b/scripts/run-clang-tidy.sh @@ -6,7 +6,7 @@ WORKDIR="$( cd $SCRIPTDIR/.. && pwd )" set -o errexit echo Making compile_command.json -rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_ROUNDTRIP_TESTING=ON +rm -rf tmp && mkdir tmp && cmake -Btmp -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSUBSTRAIT_CPP_BUILD_TESTING=OFF -DCLANG_TIDY_BUILD=ON echo Building substrait protobuf pushd tmp/src/substrait/proto make -j