cmake: defer building unitprotos.h till a test target needs it

Follow-up to c9bb9cd165 #17750
Ref: https://github.com/curl/curl/pull/17750#issuecomment-3133749477
Closes #18086
This commit is contained in:
Viktor Szakats 2025-07-29 21:15:02 +02:00
parent 00887aee8c
commit daa5b044b8
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

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