Fix error: Invalid option: '-no_warning_for_no_symbols'
https://github.com/qt/qtbase/commit/05a7cbef5b6a32edd31f42da4ace2e7ab1fd35da

diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 6bf4a9edd56..322926a5b3a 100644
--- cmake/QtBuild.cmake
+++ cmake/QtBuild.cmake
@@ -426,7 +426,7 @@ set(QT_TOP_LEVEL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 # Prevent warnings about object files without any symbols. This is a common
 # thing in Qt as we tend to build files unconditionally, and then use ifdefs
 # to compile out parts that are not relevant.
-if(CMAKE_HOST_APPLE AND APPLE)
+if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
     foreach(lang ASM C CXX)
         # We have to tell 'ar' to not run ranlib by itself, by passing the 'S' option
         set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qcS <TARGET> <LINK_FLAGS> <OBJECTS>")
