diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-09-22 00:42:38 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-09-29 03:30:18 +0000 |
commit | 1e1de2b2e16dd17efec4742a9c4892522c6319ca (patch) | |
tree | c0ae447587e8f51b5aee56e27e45f6dceef6211d /mkspecs/features/qt_common.prf | |
parent | 7fd3cc3980a25bfbc9c0aca935c2afa90230374a (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'mkspecs/features/qt_common.prf')
-rw-r--r-- | mkspecs/features/qt_common.prf | 9 |
1 files changed, 9 insertions, 0 deletions
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 |