mirror of
https://github.com/curl/curl.git
synced 2026-05-17 10:16:24 +03:00
cmake: improve setting up runtests in Windows cross-builds
Closes #20479
This commit is contained in:
parent
b619952b82
commit
1acf0c45f4
1 changed files with 11 additions and 3 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue