diff options
author | Kai Koehne <kai.koehne@qt.io> | 2020-09-07 13:14:26 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2020-09-11 17:11:03 +0200 |
commit | 199d86782075e6a4fff624784340c2d9d45c5297 (patch) | |
tree | a22af79774b92260076b0ac994c4cbad69190c04 /cmake | |
parent | 3674791ba86914e78e64eae6bc895d1bea2fdcd5 (diff) |
CMake: Fix build with Clang on Windows
win32-clang-g++/qmake.conf did define
QMAKE_CFLAGS_WARN_ON += -Wextra -Wno-ignored-attributes
probably for the same reason.
Change-Id: I14b66f2555949c03a2ea996923e31f5ec9f7105a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtInternalTargets.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 6a9ba2ab4e..1485726f0f 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -6,6 +6,12 @@ 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_HOST_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+ |