File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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 ()
725731elseif (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
You can’t perform that action at this time.
0 commit comments