Commit 1e1de2b2 authored by Jake Petroules's avatar Jake Petroules
Browse files

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: default avatarThiago Macieira <thiago.macieira@intel.com>
Showing with 9 additions and 0 deletions
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment