Fix macOS min version and bump CI (#24)
We never actually used the MACOS_MIN_VERSION variable anywhere so it was defaulting to the version of the macOS build host. The macos-10.15 Azure DevOps image is getting deprecated so bump to macos-12 and fix the build so it still compiles with a min version of 10.15 The configure checks need -Werror=unguarded-availability otherwise they'll erreanously detect presence of symbols
This commit is contained in:
Родитель
b8b6212c94
Коммит
dd60573e9d
|
@ -31,7 +31,7 @@ variables:
|
|||
- name: LinuxPool
|
||||
value: ubuntu-18.04
|
||||
- name: MacPool
|
||||
value: macos-10.15
|
||||
value: macos-12
|
||||
- name: LinuxCompilerSuffix
|
||||
value: -10
|
||||
- name: BuildScriptCommonOptions
|
||||
|
|
|
@ -48,6 +48,7 @@ if(TARGET_PLATFORM MATCHES "^host-darwin-|^ios-|^tvos-|^catalyst-")
|
|||
set(DEPLOYMENT_TARGET ${TVOS_MIN_VERSION})
|
||||
elseif(PLATFORM MATCHES "^MACOS_")
|
||||
set(INCLUDE_IOS_TOOLCHAIN False)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET ${MACOS_MIN_VERSION} CACHE STRING "Minimum OSX version")
|
||||
else()
|
||||
message(FATAL_ERROR "Platform '${PLATFORM}' not supported")
|
||||
endif()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set(IOS_MIN_VERSION "10.0")
|
||||
set(MACOS_MIN_VERSION "10.9")
|
||||
set(MACOS_MIN_VERSION "10.15")
|
||||
set(MACOS_CATALYST_MIN_VERSION "13.1")
|
||||
set(TVOS_MIN_VERSION "9.0")
|
||||
|
|
|
@ -186,6 +186,15 @@ if(APPLE)
|
|||
set(HOST_MACROS
|
||||
_DARWIN_C_SOURCE
|
||||
)
|
||||
|
||||
# Apple platforms like macOS/iOS allow targeting older operating system versions with a single SDK,
|
||||
# the mere presence of a symbol in the SDK doesn't tell us whether the deployment target really supports it.
|
||||
# The compiler raises a warning when using an unsupported API, turn that into an error so check_symbol_exists()
|
||||
# can correctly identify whether the API is supported on the target.
|
||||
check_cxx_compiler_flag("-Wunguarded-availability" "C_SUPPORTS_WUNGUARDED_AVAILABILITY")
|
||||
if(C_SUPPORTS_WUNGUARDED_AVAILABILITY)
|
||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro(_compiler_has_flag _lang _flag)
|
||||
|
|
Загрузка…
Ссылка в новой задаче