build: strip trailing spaces from libcurl.pc

Fixing:
```
$ pccritic libcurl.pc
[...]
  [info    ] file has trailing whitespace on one or more lines (style/PC062)
```

Closes #22536
This commit is contained in:
Viktor Szakats 2026-08-10 22:49:53 +02:00
parent 419f6404d4
commit 6c7993d4d9
No known key found for this signature in database
2 changed files with 9 additions and 2 deletions

View file

@ -2362,6 +2362,10 @@ if(NOT CURL_DISABLE_INSTALL)
configure_file(
"${PROJECT_SOURCE_DIR}/libcurl.pc.in"
"${PROJECT_BINARY_DIR}/libcurl.pc" @ONLY)
# Strip trailing spaces
file(READ "${PROJECT_BINARY_DIR}/libcurl.pc" _libcurl_pc)
string(REGEX REPLACE " +\n" "\n" _libcurl_pc "${_libcurl_pc}")
file(WRITE "${PROJECT_BINARY_DIR}/libcurl.pc" "${_libcurl_pc}")
install(FILES "${PROJECT_BINARY_DIR}/libcurl.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

View file

@ -5555,10 +5555,13 @@ AC_CONFIG_FILES([\
tests/http/config.ini \
tests/http/Makefile \
projects/Makefile \
projects/vms/Makefile \
libcurl.pc
projects/vms/Makefile
])
AC_CONFIG_FILES([curl-config], [chmod +x curl-config])
AC_CONFIG_FILES([libcurl.pc], [
dnl strip trailing spaces
"$SED" 's/ *$//g' libcurl.pc > libcurl.pc.tmp && mv libcurl.pc.tmp libcurl.pc
], [SED="$SED"])
AC_OUTPUT
SUPPORT_PROTOCOLS_LOWER=`echo "$SUPPORT_PROTOCOLS" | tr A-Z a-z`