diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 535e86457e8..fb87a6531f7 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -434,7 +434,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 " qcS ")