From 51b24201819db80c998d39fadfed38f9f1b085c3 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Fri, 10 Jan 2020 23:12:51 +0100 Subject: [PATCH] Add partial-availability error on macOS When building on macOS targeting an older version than the version of the SDK currently used, this prevents accidentally using APIs that are too new (introduced in macOS versions newer than the deployment target). --- desktop_version/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 3cf9ef7b..52831d72 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -10,6 +10,7 @@ IF(APPLE) SET(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk) SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) LINK_DIRECTORIES(/usr/local/lib) + ADD_COMPILE_OPTIONS(-Werror=partial-availability) ENDIF() # Compiler Flags