cmake: replace deprecated remove command with rm and pass arg safely

All curl-supported CMake versions support the modern method, along with
the `--` marker.

Also:
- make sure to pass `-f` to not fail if the file is missing, as before
  this patch.
- drop now redundant `OUTPUT_QUIET`, `ERROR_QUIET` and error handling
  in `cmake_uninstall`.
- move filename to end of the error message for readability.
- GHA/linux: test these two 'clean' targets in the aws-lc job.

Refs:
https://cmake.org/cmake/help/v4.4/manual/cmake.1.html#cmdoption-cmake-E-arg-remove
https://cmake.org/cmake/help/v3.18/manual/cmake.1.html#run-a-command-line-tool

Closes #22193
This commit is contained in:
Viktor Szakats 2026-06-26 17:25:16 +02:00
parent a7e8016fa2
commit 6d008352c6
No known key found for this signature in database
3 changed files with 10 additions and 12 deletions

View file

@ -79,7 +79,7 @@ jobs:
- name: 'awslc'
install_packages: libidn2-dev
install_steps: awslc
install_steps: awslc clean
generate: -DOPENSSL_ROOT_DIR=/home/runner/awslc -DUSE_ECH=ON -DCMAKE_UNITY_BUILD=OFF -DCURL_DROP_UNUSED=ON -DCURL_PATCHSTAMP=test-patch -DCURL_ENABLE_NTLM=ON
- name: 'boringssl'
@ -916,6 +916,9 @@ jobs:
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --install bld --strip
if [[ "${MATRIX_INSTALL_STEPS}" = *'clean'* ]]; then
cmake --build bld --target curl_uninstall
fi
else
make -C bld V=1 install
fi
@ -962,6 +965,9 @@ jobs:
fi
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target "${TEST_TARGET}"
if [[ "${MATRIX_INSTALL_STEPS}" = *'clean'* ]]; then
cmake --build bld --target clean-certs
fi
else
make -C bld V=1 "${TEST_TARGET}"
fi