From: Viktor Szakats Date: Tue, 29 Jul 2025 19:15:02 +0000 (+0200) Subject: cmake: defer building `unitprotos.h` till a test target needs it X-Git-Tag: curl-8_16_0~328 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=daa5b044b8dc9e14f9393e4d73da8732fb647276;p=thirdparty%2Fcurl.git cmake: defer building `unitprotos.h` till a test target needs it Follow-up to c9bb9cd165c1b25c2fe005befdcfe479fc9b68e1 #17750 Ref: https://github.com/curl/curl/pull/17750#issuecomment-3133749477 Closes #18086 --- diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 1272347d3a..5d49cfa53c 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -55,7 +55,7 @@ if(CURL_BUILD_TESTING) ${CSOURCES} > "${CMAKE_CURRENT_BINARY_DIR}/unitprotos.h" DEPENDS "${PROJECT_SOURCE_DIR}/scripts/extract-unit-protos" ${CSOURCES} VERBATIM) - add_custom_target(curlu-unitprotos ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/unitprotos.h") + add_custom_target(curlu-unitprotos DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/unitprotos.h") endif() ## Library definition