From: Viktor Szakats Date: Sat, 21 Jun 2025 08:00:22 +0000 (+0200) Subject: cmake: omit clang-tidy on internal libs curlu and curltool X-Git-Tag: curl-8_15_0~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccb65643b6a6570f79432bb18418367ecba458ad;p=thirdparty%2Fcurl.git cmake: omit clang-tidy on internal libs curlu and curltool Skip clang-tidy while compiling curlu and curltool internal libraries. To save about 1 minute per run. These libraries compile the lib and src sources a second time, with the `UNITTESTS` macro enabled, which makes tiny difference, for internal use. I figure it's not worth the extra CI (and local) time because finding extra issues in these passes is unlikely, and if found, not critical. autotools also doesn't check curlu and curltool with clang-tidy. Ref: https://github.com/curl/curl/pull/17680#issuecomment-2991730158 Ref: https://stackoverflow.com/questions/61867616/ignore-certain-files-when-using-clang-tidy Ref: https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html Follow-up to fabfa8e4024473035b3e5c3c30c330be726d9bb4 #15825 Closes #17693 --- diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4a1a2fad6b..23848e1ddb 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -52,7 +52,7 @@ if(CURL_BUILD_TESTING) target_link_libraries(curlu PRIVATE ${CURL_LIBS}) # There is plenty of parallelism when building the testdeps target. # Override the curlu batch size with the maximum to optimize performance. - set_target_properties(curlu PROPERTIES UNITY_BUILD_BATCH_SIZE 0) + set_target_properties(curlu PROPERTIES UNITY_BUILD_BATCH_SIZE 0 C_CLANG_TIDY "") endif() ## Library definition diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bdf245ffa6..abeb2b095e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -96,6 +96,7 @@ add_executable(curlinfo EXCLUDE_FROM_ALL "curlinfo.c") add_library(curltool STATIC EXCLUDE_FROM_ALL ${CURL_CFILES} ${CURL_HFILES}) target_compile_definitions(curltool PUBLIC "CURL_STATICLIB" "UNITTESTS") target_link_libraries(curltool PRIVATE ${CURL_LIBS}) +set_target_properties(curltool PROPERTIES C_CLANG_TIDY "") if(CURL_HAS_LTO) set_target_properties(${EXE_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)