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
This commit is contained in:
Viktor Szakats 2026-02-27 13:43:51 +01:00
parent 9d727e4e55
commit 00b215b894
No known key found for this signature in database

View file

@ -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()