Skip to content

Commit 5471438

Browse files
authored
Merge pull request #181 from leetal/leetal-patch-1
Fixes #160
2 parents 9dba5f6 + 46a038d commit 5471438

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ios.toolchain.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,14 @@ if(MODERN_CMAKE)
719719
endif()
720720
# Provide flags for a combined FAT library build on newer CMake versions
721721
if(PLATFORM_INT MATCHES ".*COMBINED")
722-
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
723722
set(CMAKE_IOS_INSTALL_COMBINED YES)
723+
if(CMAKE_GENERATOR MATCHES "Xcode")
724+
# Set the SDKROOT Xcode properties to a Xcode-friendly value (the SDK_NAME, E.g, iphoneos)
725+
# This way, Xcode will automatically switch between the simulator and device SDK when building.
726+
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT "${SDK_NAME}")
727+
# Force to not build just one ARCH, but all!
728+
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
729+
endif()
724730
endif()
725731
elseif(NOT DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10")
726732
# Legacy code path prior to CMake 3.14 or fallback if no CMAKE_SYSTEM_NAME specified

0 commit comments

Comments
 (0)