System.Native: Make configure.cmake checks work for iOS (dotnet/corefx#42408)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 6 Nov 2019 15:09:40 +0000 (16:09 +0100)
committerStephen Toub <stoub@microsoft.com>
Wed, 6 Nov 2019 15:09:40 +0000 (10:09 -0500)
commit95eb086b5002eb916cbb87ba100802987e2f2c16
tree5b1cdf259ea44b4feef3b90c2d312c25e38a2e48
parent6656c72a2208cb15ba15c070196b24379d38113f
System.Native: Make configure.cmake checks work for iOS (dotnet/corefx#42408)

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 https://github.com/dotnet/corefx/pull/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

Commit migrated from https://github.com/dotnet/corefx/commit/879127eb87346200b4ddf40a7fce96e79ec211fe
src/libraries/Native/Unix/configure.cmake