]> git.ipfire.org Git - thirdparty/curl.git/commit
cmake: fix generation for system name iOS
authorMark Sinkovics <sinkovics.mark@gmail.com>
Thu, 14 Dec 2023 00:49:55 +0000 (19:49 -0500)
committerViktor Szakats <commit@vsz.me>
Sat, 16 Dec 2023 22:04:40 +0000 (22:04 +0000)
commita86254b39307af1a53735b065a382567805cd9b8
tree1f0311148707d649b9ed36ae728264c995a1fa55
parentb29d1e887f25a830a8f69a15d20faa676b6ce07d
cmake: fix generation for system name iOS

This PR fixes a problem that happens during CMake configuration when
the `CMAKE_SYSTEM_NAME` set to `iOS` and not `Darwin`. This value is
available (as far as I remember) version 3.14. The final solution
(thanks to @vszakats) is to use `APPLE` which contains all the Apple
platforms https://cmake.org/cmake/help/latest/variable/APPLE.html.

This issue was found when during vcpkg installation. Running command
`vcpkg install curl:arm64-ios` and `vcpkg install curl:x64-ios` failed
with message:
```
CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   HAVE_H_ERRNO_ASSIGNABLE_EXITCODE (advanced)
```
After this fix, I was able to compile the compile the binary without
any issue.

In addition to that fix, this PR also contains an simplification to
check if the platform is not APPLE.

Co-authored-by: Viktor Szakats
Closes #12515
CMake/OtherTests.cmake