mirror of
https://github.com/curl/curl.git
synced 2026-08-04 13:46:26 +03:00
cmake: replace CMAKE_COMPILER_IS_GNUCC with CMAKE_C_COMPILER_ID
Variable `CMAKE_COMPILER_IS_GNUCC` is deprecated and `CMAKE_C_COMPILER_ID` should be used instead. Closes #16797
This commit is contained in:
parent
d03429ce03
commit
dd0c9feb54
5 changed files with 10 additions and 10 deletions
|
|
@ -42,7 +42,7 @@ if(CURL_HIDDEN_SYMBOLS)
|
|||
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
|
||||
set(CURL_EXTERN_SYMBOL "__attribute__((__visibility__(\"default\")))")
|
||||
set(CURL_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden")
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
# Note: This is considered buggy prior to 4.0 but the autotools do not care, so let us ignore that fact
|
||||
set(CURL_HIDES_PRIVATE_SYMBOLS TRUE)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ include(CheckCCompilerFlag)
|
|||
set(_picky "")
|
||||
|
||||
if(CURL_WERROR AND
|
||||
((CMAKE_COMPILER_IS_GNUCC AND
|
||||
((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
|
||||
NOT DOS AND # Watt-32 headers use the '#include_next' GCC extension
|
||||
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0 AND
|
||||
NOT CMAKE_VERSION VERSION_LESS 3.23.0) OR # to avoid check_symbol_exists() conflicting with GCC -pedantic-errors
|
||||
|
|
@ -40,7 +40,7 @@ if(APPLE AND
|
|||
list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.3
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
list(APPEND _picky "-Werror-implicit-function-declaration") # clang 1.0 gcc 2.95
|
||||
endif()
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ elseif(BORLAND)
|
|||
endif()
|
||||
|
||||
if(PICKY_COMPILER)
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
# https://clang.llvm.org/docs/DiagnosticsReference.html
|
||||
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
|
|
@ -254,7 +254,7 @@ if(PICKY_COMPILER)
|
|||
endif()
|
||||
endforeach()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
|
||||
# Avoid false positives
|
||||
list(APPEND _picky "-Wno-shadow")
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if((CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) OR
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6))
|
||||
# MinGW or clang-cl
|
||||
set(HAVE_STDATOMIC_H 1)
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ if(WINDOWS_STORE AND MINGW) # mingw UWP build
|
|||
# CMake (as of v3.31.2) gets confused and applies the MSVC rc.exe command-line
|
||||
# template to windres. Reset it to the windres template via 'Modules/Platform/Windows-windres.cmake':
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>")
|
||||
elseif(WIN32 AND WINCE AND CMAKE_COMPILER_IS_GNUCC) # mingw32ce build
|
||||
elseif(WIN32 AND WINCE AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # mingw32ce build
|
||||
if(NOT MINGW32CE_LIBRARY_DIR)
|
||||
message(FATAL_ERROR "Set MINGW32CE_LIBRARY_DIR variable to the mingw32ce platform library directory.")
|
||||
endif()
|
||||
|
|
@ -118,7 +118,7 @@ elseif(WIN32 AND WINCE AND CMAKE_COMPILER_IS_GNUCC) # mingw32ce build
|
|||
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib")
|
||||
elseif(DOS AND CMAKE_COMPILER_IS_GNUCC) # DJGPP
|
||||
elseif(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # DJGPP
|
||||
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
|
||||
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
|
||||
|
|
@ -161,7 +161,7 @@ endif()
|
|||
if(AMIGA)
|
||||
string(APPEND _target_flags " AMIGA")
|
||||
endif()
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
string(APPEND _target_flags " GCC")
|
||||
endif()
|
||||
if(MINGW)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ function(curl_add_pytests _targetname _test_flags)
|
|||
endfunction()
|
||||
|
||||
# Create configurehelp.pm, used by tests needing to run the C preprocessor.
|
||||
if(MSVC OR CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if(MSVC OR CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(CURL_CPP "\"${CMAKE_C_COMPILER}\" -E")
|
||||
if(APPLE AND CMAKE_OSX_SYSROOT)
|
||||
string(APPEND CURL_CPP " -isysroot ${CMAKE_OSX_SYSROOT}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue