Check for the correct apple clang version with warnings_are_errors

The current state of qtbase is confirmed to be built with no warnings
when using up to Xcode 9.2, as per the check in
mkspecs/features/qt_common.prf. Add the same check for the CMake
build.

Change-Id: I0c2409ece048e93fba29c41a8bd053dd112949bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
bb10
Alexandru Croitor 2019-06-24 15:51:45 +02:00
parent d2c2ff8337
commit a37771ebc5
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ function(qt_internal_set_warnings_are_errors_flags target)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
# using AppleClang
# Apple clang 4.0+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "4.0.0")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "4.0.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL "9.2")
target_compile_options("${target}" INTERFACE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations)
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")