build: show llvm/clang in platform flags and buildinfo.txt

Show these flags:
- `LLVM-CLANG` for mainline llvm/clang.
- `APPLE-CLANG` for Apple clang.
- `CLANG-CL` for clang-cl. (cmake only)

Also:
- GHA/linux: fix a job to build with clang, to match its descriptions.

Closes #18645
This commit is contained in:
Viktor Szakats 2025-09-20 19:04:21 +02:00
parent 4189c2c0fe
commit 0513f9f878
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 15 additions and 0 deletions

View file

@ -179,6 +179,7 @@ jobs:
- name: 'openssl clang krb5 LTO'
install_packages: zlib1g-dev libkrb5-dev clang
install_steps: skiprun
CC: clang
generate: -DCURL_USE_OPENSSL=ON -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DCURL_LTO=ON
- name: 'openssl !ipv6 !--libcurl !--digest-auth'

View file

@ -148,6 +148,15 @@ endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
string(APPEND _target_flags " GCC")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
string(APPEND _target_flags " APPLE-CLANG")
elseif(MSVC)
string(APPEND _target_flags " CLANG-CL")
else()
string(APPEND _target_flags " LLVM-CLANG")
endif()
endif()
if(MINGW)
string(APPEND _target_flags " MINGW")
endif()

View file

@ -1492,6 +1492,11 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [
if test "x$compiler_id" = 'xGNU_C'; then
curl_pflags="${curl_pflags} GCC"
fi
if "$compiler_id" = "APPLECLANG"; then
curl_pflags="${curl_pflags} APPLE-CLANG"
elif test "$compiler_id" = "CLANG"; then
curl_pflags="${curl_pflags} LLVM-CLANG"
fi
case $host_os in
mingw*) curl_pflags="${curl_pflags} MINGW";;
esac