]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: drop `HAVE_C_FLAG_Wno_long_double` logic for ancient Apple gcc
authorViktor Szakats <commit@vsz.me>
Thu, 27 Feb 2025 22:54:47 +0000 (23:54 +0100)
committerViktor Szakats <commit@vsz.me>
Fri, 28 Feb 2025 02:40:40 +0000 (03:40 +0100)
The initial curl CMake commit introduced it in 2009-04-02 via
4c5307b45655ba75ab066564afdc0c111a8b9291. Suppressing a stray
`-Wlong-double` warning in `mprintf.c`. This was before Apple switched
to clang, and likely affected the Apple distributed GCC, version 4.2.1
at the time. It applied the workaround to CMake builds only, though
the issue seems build-tool agnostic. Yet, it was not suppressed or
reported for autotools builds.

For these reasons this logic seems obsolete and this patch drops it with
no replacement. It saves a feature detection for GCC builds for macOS.

In PR sub-commits I added (and reverted) in-source suppression. In case
it becomes necessary, that should fix it for all build tools.

Closes #16513

CMakeLists.txt

index 6795b67967061b58b92aee6bbf0b85913c011af4..0f0fa1a66870da86aaef5bf33ace41a6421b89e1 100644 (file)
@@ -1954,22 +1954,6 @@ endif()
 
 # Some other minor tests
 
-if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
-  include(CheckCCompilerFlag)
-  check_c_compiler_flag("-Wno-long-double" HAVE_C_FLAG_Wno_long_double)
-  if(HAVE_C_FLAG_Wno_long_double)
-    # The Mac version of GCC warns about use of long double. Disable it.
-    get_source_file_property(_mprintf_compile_flags "mprintf.c" COMPILE_FLAGS)
-    if(_mprintf_compile_flags)
-      string(APPEND _mprintf_compile_flags " -Wno-long-double")
-    else()
-      set(_mprintf_compile_flags "-Wno-long-double")
-    endif()
-    set_source_files_properties("mprintf.c" PROPERTIES
-      COMPILE_FLAGS ${_mprintf_compile_flags})
-  endif()
-endif()
-
 if(_cmake_try_compile_target_type_save)
   set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_cmake_try_compile_target_type_save})
   unset(_cmake_try_compile_target_type_save)