← Commit list

1acf0c45f4

Viktor Szakats
Viktor Szakats
2026-01-30
SUCCESS Duration: 347s

Subject

cmake: improve setting up runtests in Windows cross-builds

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

tests/CMakeLists.txt+11 -3
@@ -64,9 +64,17 @@ function(curl_add_runtests _targetname _test_flags)
endif()
list(APPEND _depends "testdeps")
endif()
- set(_setenv "")
+ set(_setenvs "")
if(CMAKE_CONFIGURATION_TYPES)
- set(_setenv "${CMAKE_COMMAND}" -E env "CURL_DIRSUFFIX=$<CONFIG>")
+ list(APPEND _setenvs "CURL_DIRSUFFIX=$<CONFIG>")
+ endif()
+ if(WIN32 AND NOT CMAKE_HOST_WIN32)
+ list(APPEND _setenvs "CURL_TEST_EXE_EXT_SRV=${CMAKE_EXECUTABLE_SUFFIX}") # .exe
+ list(APPEND _setenvs "CURL_TEST_EXE_EXT_TOOL=${CMAKE_EXECUTABLE_SUFFIX}") # .exe
+ list(APPEND _setenvs "CURL_TEST_EXE_RUNNER=wine")
+ endif()
+ if(_setenvs)
+ set(_setenvs "${CMAKE_COMMAND}" -E env ${_setenvs})
endif()
# Use a special '$TFLAGS' placeholder as last argument which will be
# replaced by the contents of the environment variable in runtests.pl.
@@ -75,7 +83,7 @@ function(curl_add_runtests _targetname _test_flags)
string(REPLACE " " ";" _test_flags_list "${_test_flags}")
add_custom_target(${_targetname}
COMMAND
- ${_setenv}
+ ${_setenvs}
"${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runtests.pl"
${_test_flags_list}
"\$TFLAGS"