Skip to content

Commit 7fdfae9

Browse files
committed
Add APPLE_EMBEDDED boolean to designate when using the CMake supported cross compilation targets
1 parent 7fe3958 commit 7fdfae9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

cmake/defaults/ProjectDefaults.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ if(APPLE)
4242
if (CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20)
4343
set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed")
4444
endif()
45+
46+
# Cross Compilation as defined in CMake docs
47+
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
48+
# Note: All these SDKs may not be supported by OpenUSD, but are all listed here for future proofing
49+
set(APPLE_EMBEDDED OFF)
50+
if (CMAKE_SYSTEM_NAME MATCHES "iOS"
51+
OR CMAKE_SYSTEM_NAME MATCHES "tvOS"
52+
OR CMAKE_SYSTEM_NAME MATCHES "visionOS"
53+
OR CMAKE_SYSTEM_NAME MATCHES "watchOS")
54+
set(APPLE_EMBEDDED ON)
55+
endif ()
4556
endif()
4657

4758
# Allow local includes from source directory.

0 commit comments

Comments
 (0)