From 1e1de2b2e16dd17efec4742a9c4892522c6319ca Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 22 Sep 2017 00:42:38 -0700 Subject: Make it an error to omit __builtin_available where needed This guarantees that we have proper version checks in place for APIs on Apple platforms that are not necessarily available on the deployment target. Change-Id: I10060f8b910f2bb790aa4a9c6f8c5cdc14d7cf06 Reviewed-by: Thiago Macieira --- mkspecs/features/qt_common.prf | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mkspecs/features/qt_common.prf') diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index b8e397cda3..f4ae5bde80 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -58,6 +58,15 @@ clang { clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION} versionAtLeast(clang_ver, 3.5): \ QMAKE_CXXFLAGS_WARN_ON += -Wdate-time + + # Clang/LLVM 5.0 and Xcode 9.0 introduced unguarded availability warnings. + # The same construct has been a hard error in Swift from the very beginning. + apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION} + darwin:if(versionAtLeast(clang_ver, 5.0)|versionAtLeast(apple_ver, 9.0)): \ + QMAKE_CXXFLAGS_WARN_ON += \ + -Werror=unguarded-availability \ + -Werror=unguarded-availability-new \ + -Werror=unsupported-availability-guard } else: gcc:!intel_icc { QMAKE_CXXFLAGS_WARN_ON += -Wvla # GCC 5 introduced -Wdate-time -- cgit v1.2.3