From 00b215b894cac0e21f620a88c299408a57ee2f75 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 27 Feb 2026 13:43:51 +0100 Subject: [PATCH] cmake: convert `curl_add_clang_tidy_test_target()` macro to function I thought a macro is necessary to have `get_directory_property()` and `CMAKE_CURRENT_SOURCE_DIR` work on the correct directory, but it turns out they do work the same when used in a function. Closes #20760 --- CMake/Macros.cmake | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/CMake/Macros.cmake b/CMake/Macros.cmake index bf0ca1297f..0ae126333a 100644 --- a/CMake/Macros.cmake +++ b/CMake/Macros.cmake @@ -131,7 +131,7 @@ macro(curl_collect_target_options _target) endmacro() # Create a clang-tidy target for test targets -macro(curl_add_clang_tidy_test_target _target_clang_tidy _target) +function(curl_add_clang_tidy_test_target _target_clang_tidy _target) if(CURL_CLANG_TIDY) set(_definitions "") @@ -233,14 +233,5 @@ macro(curl_add_clang_tidy_test_target _target_clang_tidy _target) ${_sources} -- ${_cc} ${_definitions} ${_includes} ${_incsys} ${_options} DEPENDS ${_sources}) add_dependencies(tests-clang-tidy ${_target_clang_tidy}) - - unset(_sys_incdirs) - unset(_cc) - unset(_definitions) - unset(_includes) - unset(_incsys) - unset(_incsys_tmp) - unset(_options) - unset(_sources) endif() -endmacro() +endfunction()