diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index a04e216943..108571e759 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -6,12 +6,6 @@ function(qt_internal_set_warnings_are_errors_flags target) if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "3.0.0") list(APPEND flags -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) endif() - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - # Clang will otherwise show error about inline method conflicting with dllimport class attribute in tools - # (this was tested with Clang 10) - # error: 'QString::operator[]' redeclared inline; 'dllimport' attribute ignored [-Werror,-Wignored-attributes] - list(APPEND flags -Wno-ignored-attributes) - endif() elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") # using AppleClang # Apple clang 4.0+ @@ -110,6 +104,13 @@ if(FEATURE_largefile AND UNIX) INTERFACE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") endif() +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_SYSTEM_NAME STREQUAL "Windows") + # Clang will otherwise show error about inline method conflicting with dllimport class attribute in tools + # (this was tested with Clang 10) + # error: 'QString::operator[]' redeclared inline; 'dllimport' attribute ignored [-Werror,-Wignored-attributes] + target_compile_options(PlatformCommonInternal INTERFACE -Wno-ignored-attributes) +endif() + # We can't use the gold linker on android with the NDK, which is the default # linker. To build our own target we will use the lld linker. # TODO: Why not?