QtFlagHandlingHelpers.cmake: account for GCC when producing error

This changes the error message I get when configuring with
-DFEATURE_sanitize_thread=ON from:

    CMake Error at cmake/QtFlagHandlingHelpers.cmake:183 (message):
      Platform linker doesn't support erroring upon encountering undefined
      symbols.  Target:"Core".
    Call Stack (most recent call first):
      cmake/QtModuleHelpers.cmake:898 (qt_internal_add_link_flags_no_undefined)
      src/corelib/CMakeLists.txt:30 (qt_internal_add_module)

  to:

      ERROR: detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr

    CMake Error at cmake/QtBuildInformation.cmake:240 (message):
      Check the configuration messages for an error that has occurred.
    Call Stack (most recent call first):
      cmake/QtBuildInformation.cmake:59 (qt_configure_print_summary)
      cmake/QtBuildRepoHelpers.cmake:393 (qt_print_feature_summary)
      cmake/QtBaseHelpers.cmake:287 (qt_build_repo_end)
      CMakeLists.txt:36 (qt_internal_qtbase_build_repo)

Pick-to: 6.8 6.9
Change-Id: If6243362521802d8b1348ae53d744c33add814f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Mitch Curtis 2025-05-27 11:22:31 +08:00
parent c2bdf7636e
commit c29868830c

View File

@ -160,7 +160,7 @@ function(qt_internal_add_link_flags_no_undefined target)
return()
endif()
if ((GCC OR CLANG) AND NOT MSVC)
if(CLANG AND QT_FEATURE_sanitizer)
if((GCC OR CLANG) AND QT_FEATURE_sanitizer)
return()
endif()
set(previous_CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})