mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:21:42 +03:00
cmake: clang detection tidy-ups
Follow-up to0513f9f878#18645 Follow-up tofe5225b5ea#18209 Closes #18659
This commit is contained in:
parent
c23d7e7a98
commit
06d00e3879
2 changed files with 7 additions and 9 deletions
|
|
@ -148,14 +148,12 @@ 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()
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
string(APPEND _target_flags " APPLE-CLANG")
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
|
||||
string(APPEND _target_flags " CLANG-CL")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
string(APPEND _target_flags " LLVM-CLANG")
|
||||
endif()
|
||||
if(MINGW)
|
||||
string(APPEND _target_flags " MINGW")
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ foreach(_target IN LISTS check_PROGRAMS _all) # keep '_all' last
|
|||
set(_examples_c "${check_PROGRAMS}")
|
||||
list(TRANSFORM _examples_c APPEND ".c")
|
||||
add_library(${_target_name} OBJECT EXCLUDE_FROM_ALL ${_examples_c})
|
||||
if(MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl
|
||||
# CMake generates a static library for the OBJECT target. Silence these 'lib.exe' warnings:
|
||||
# warning LNK4006: main already defined in ....obj; second definition ignored
|
||||
# warning LNK4221: This object file does not define any previously undefined public symbols,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue