Skip to content

macOS: Allow macOS SDK for Catalyst using iOS toolchain

Hello!

I'm working on getting a MacOS Catalyst library to compile with CMake. An issue I'm running into is that iOS-Initialize.cmake will throw a failure if you try to link against the MacOS SDK. That comes down to these lines:

if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhone(OS|Simulator)")
  message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an iOS SDK")
endif()

This test needs to be changed for Catalyst, as building for Catalyst requires you to use the MacOS SDK. To that end, this PR adds an extra check to prevent that error in the case where Catalyst is explicitly specified.

Now, I'm very new to CMake, so I imagine this could be done a lot better. Please feel free to rewrite this branch as you see fit. I just wanted to get the conversation started.

Thank you!

Topic-rename: macos-ios-catalyst

Edited by Brad King

Merge request reports