System.Native: Make configure.cmake checks work for iOS#42408
System.Native: Make configure.cmake checks work for iOS#42408stephentoub merged 1 commit intodotnet:masterfrom
Conversation
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. This fixes compile errors after dotnet#37583 was merged since `clonefile()` is iOS10+. Replace usages of `check_function_exists()` since it only tests for existence of functions and the CMake docs recommend using `check_symbol_exists()`: https://cmake.org/cmake/help/v3.15/module/CheckFunctionExists.html
filipnavara
left a comment
There was a problem hiding this comment.
The change itself looks fine to me.
I do, however, think that the macOS and iOS minimum version requirements should be aligned for CoreFX - ie. macOS 10.X minumum requirement should map to iOS X-2 minimum requirement. At the moment the minumum requirement for macOS is 10.13 which would map to iOS 11. Anything older than iOS 10 is going to be difficult to support because of Crypto API differences. It's also bit unfortunate to lose clonefile support even on platforms that support it.
|
Agreed. It looks like we currently don't pass any minimum target version for macOS to CMake so it uses the version of the build host. That should be fixed.
For the reason mentioned above this doesn't happen. |
As noticed in dotnet#42408 we don't pass any minimum OSX target version to CMake. This means it falls back to the host version, e.g. if you build on Mojave it would pass `-mmacosx-version-min=10.14` to the compiler. .NET Core's minimum supported OSX version is 10.13 so pass that to CMake.
As noticed in #42408 we don't pass any minimum OSX target version to CMake. This means it falls back to the host version, e.g. if you build on Mojave it would pass `-mmacosx-version-min=10.14` to the compiler. .NET Core's minimum supported OSX version is 10.13 so pass that to CMake.
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.This fixes compile errors after #37583 was merged since
clonefile()is iOS10+.Replace usages of
check_function_exists()since it only tests for existence of functions and the CMake docs recommend usingcheck_symbol_exists(): https://cmake.org/cmake/help/v3.15/module/CheckFunctionExists.html