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:
Alexander Köplinger 2022-07-15 21:10:11 +02:00 коммит произвёл GitHub
Родитель b8b6212c94
Коммит dd60573e9d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -31,7 +31,7 @@ variables:
- name: LinuxPool - name: LinuxPool
value: ubuntu-18.04 value: ubuntu-18.04
- name: MacPool - name: MacPool
value: macos-10.15 value: macos-12
- name: LinuxCompilerSuffix - name: LinuxCompilerSuffix
value: -10 value: -10
- name: BuildScriptCommonOptions - name: BuildScriptCommonOptions

Просмотреть файл

@ -48,6 +48,7 @@ if(TARGET_PLATFORM MATCHES "^host-darwin-|^ios-|^tvos-|^catalyst-")
set(DEPLOYMENT_TARGET ${TVOS_MIN_VERSION}) set(DEPLOYMENT_TARGET ${TVOS_MIN_VERSION})
elseif(PLATFORM MATCHES "^MACOS_") elseif(PLATFORM MATCHES "^MACOS_")
set(INCLUDE_IOS_TOOLCHAIN False) set(INCLUDE_IOS_TOOLCHAIN False)
set(CMAKE_OSX_DEPLOYMENT_TARGET ${MACOS_MIN_VERSION} CACHE STRING "Minimum OSX version")
else() else()
message(FATAL_ERROR "Platform '${PLATFORM}' not supported") message(FATAL_ERROR "Platform '${PLATFORM}' not supported")
endif() endif()

Просмотреть файл

@ -1,4 +1,4 @@
set(IOS_MIN_VERSION "10.0") 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(MACOS_CATALYST_MIN_VERSION "13.1")
set(TVOS_MIN_VERSION "9.0") set(TVOS_MIN_VERSION "9.0")

Просмотреть файл

@ -186,6 +186,15 @@ if(APPLE)
set(HOST_MACROS set(HOST_MACROS
_DARWIN_C_SOURCE _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() endif()
macro(_compiler_has_flag _lang _flag) macro(_compiler_has_flag _lang _flag)