]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: set `CURL_DIRSUFFIX` automatically in multi-config builds
authorViktor Szakats <commit@vsz.me>
Sat, 9 Aug 2025 15:36:40 +0000 (17:36 +0200)
committerViktor Szakats <commit@vsz.me>
Sat, 9 Aug 2025 22:33:45 +0000 (00:33 +0200)
To make it easier to run tests when using the Visual Studio generator,
also perhaps Xcode.

Also drop manual settings from CI.

Closes #18241

.github/workflows/windows.yml
appveyor.sh
tests/CMakeLists.txt

index 5d9aac713b94c0cb8ae13722cbe6005e30e806f9..6b8fd89b8b05bd8cf28b620eeac6bc10c4d9deca 100644 (file)
@@ -912,7 +912,6 @@ jobs:
         env:
           TFLAGS: '${{ matrix.tflags }}'
         run: |
-          export CURL_DIRSUFFIX="${MATRIX_TYPE}"
           TFLAGS="-j8 ${TFLAGS}"
           TFLAGS+=' !498'  # 'Reject too large HTTP response headers on endless redirects' HTTP, HTTP GET (runtests detecting result code 2009 instead of 56 returned by curl)
           if [[ "${MATRIX_INSTALL_MSYS2}" = *'libssh2-wincng'* || \
index e9871415e006d26db77dc808021db1acdbedbc1d..767ec1638eafd4aad265be316b739bb61189b11e 100644 (file)
@@ -141,7 +141,6 @@ fi
 
 if [ "${TFLAGS}" != 'skipall' ] && \
    [ "${TFLAGS}" != 'skiprun' ]; then
-  export CURL_DIRSUFFIX="${PRJ_CFG}"
   if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
     TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
   elif [ -x "$(cygpath 'C:/msys64/usr/bin/curl.exe')" ]; then
index 56241b889a95928acb962e9fa74d8db5257d1458..014fe0db873f85f90d315ce8d68a978f3c9138d4 100644 (file)
@@ -61,6 +61,10 @@ function(curl_add_runtests _targetname _test_flags)
     endif()
     list(APPEND _depends "testdeps")
   endif()
+  set(_setenv "")
+  if(CMAKE_CONFIGURATION_TYPES)
+    set(_setenv "${CMAKE_COMMAND}" -E env "CURL_DIRSUFFIX=$<CONFIG>")
+  endif()
   # Use a special '$TFLAGS' placeholder as last argument which will be
   # replaced by the contents of the environment variable in runtests.pl.
   # This is a workaround for CMake's limitation where commands executed by
@@ -68,6 +72,7 @@ function(curl_add_runtests _targetname _test_flags)
   string(REPLACE " " ";" _test_flags_list "${_test_flags}")
   add_custom_target(${_targetname}
     COMMAND
+      ${_setenv}
       "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runtests.pl"
       ${_test_flags_list}
       "\$TFLAGS"