Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting of CMAKE_SYSTEM_NAME #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions ios.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -724,18 +724,24 @@ endforeach()
# CMake 3.14+ support building for iOS, watchOS, and tvOS out of the box.
if(MODERN_CMAKE)
if(SDK_NAME MATCHES "iphone")
set(CMAKE_SYSTEM_NAME iOS)
set(TOOLCHAIN_SYSTEM_NAME iOS)
elseif(SDK_NAME MATCHES "xros")
set(CMAKE_SYSTEM_NAME visionOS)
set(TOOLCHAIN_SYSTEM_NAME visionOS)
elseif(SDK_NAME MATCHES "xrsimulator")
set(CMAKE_SYSTEM_NAME visionOS)
set(TOOLCHAIN_SYSTEM_NAME visionOS)
elseif(SDK_NAME MATCHES "macosx")
set(CMAKE_SYSTEM_NAME Darwin)
set(TOOLCHAIN_SYSTEM_NAME Darwin)
elseif(SDK_NAME MATCHES "appletv")
set(CMAKE_SYSTEM_NAME tvOS)
set(TOOLCHAIN_SYSTEM_NAME tvOS)
elseif(SDK_NAME MATCHES "watch")
set(CMAKE_SYSTEM_NAME watchOS)
set(TOOLCHAIN_SYSTEM_NAME watchOS)
endif()

# This is done because simply setting CMAKE_SYSTEM_NAME already enables CMAKE_CROSSCOMPILING, which is undesirable when building on mac for mac.
if(NOT ${CMAKE_HOST_SYSTEM_NAME} STREQUAL ${TOOLCHAIN_SYSTEM_NAME})
set(CMAKE_SYSTEM_NAME ${TOOLCHAIN_SYSTEM_NAME})
endif()

# Provide flags for a combined FAT library build on newer CMake versions
if(PLATFORM_INT MATCHES ".*COMBINED")
set(CMAKE_IOS_INSTALL_COMBINED YES)
Expand Down
Loading