How to properly configure CMake script to run with osx_deployment_target 10.10?

CMake Issue.

CMake has a note at check_function_exists help page.


Prefer using CheckSymbolExists instead of this module, for the following reasons:

  • check_function_exists() can’t detect functions that are inlined in headers or specified as a macro.
  • check_function_exists() can’t detect anything in the 32-bit versions of the Win32 API, because of a mismatch in calling conventions.
  • check_function_exists() only verifies linking, it does not verify that the function is declared in system headers.

futimens neither inlined nor a macros nor a part of Win32 API.
What I’m worried about is a last point.
What if a function isn’t declared but it exists in previous versions of macOS?
It makes sense why check_function_exists confirms existence of futimens.