]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix not to build `tunits` when `BUILD_CURL_EXE=OFF`
authorViktor Szakats <commit@vsz.me>
Fri, 26 Jun 2026 18:45:07 +0000 (20:45 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 26 Jun 2026 19:12:35 +0000 (21:12 +0200)
It fails as expected, with a list of errors:
```
In file included from _x64-win-ucrt-for-trurl-bld/tests/tunit/tunits.c:5:
tests/tunit/tool1394.c:76:11: error: call to undeclared function 'parse_cert_parameter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   76 |     err = parse_cert_parameter(p->param, &certname, &passphrase);
      |           ^
[...]
tests/tunit/tool1622.c:68:5: error: call to undeclared function 'timebuf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   68 |     timebuf(buffer, sizeof(buffer), secs);
      |     ^
[...]
tests/tunit/tool1623.c:104:26: error: call to undeclared function 'GetSizeParameter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  104 |     ParameterError err = GetSizeParameter(check[i].input, &output);
      |                          ^
[...]
```
Ref: https://github.com/curl/curl/actions/runs/28256499057/job/83720797064?pr=22195

Ref: #22195
Ref: https://github.com/curl/curl-for-win/commit/640fed88b65052e944edb466387bd8a062bd9b37

Closes #22198

tests/CMakeLists.txt

index 6de7f96d0a2674e0b6eb268404d8980014dee2e9..55928fac511c7d6020e01e117adfad29c088303b 100644 (file)
@@ -51,7 +51,9 @@ add_dependencies(testdeps "tt")
 add_subdirectory(http)
 add_subdirectory(server)
 add_subdirectory(libtest)
-add_subdirectory(tunit)
+if(BUILD_CURL_EXE)
+  add_subdirectory(tunit)
+endif()
 add_subdirectory(unit)
 add_subdirectory(certs)