@@ -442,25 +442,25 @@ execute_process(COMMAND uname -r
442442 OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION
443443 ERROR_QUIET
444444 OUTPUT_STRIP_TRAILING_WHITESPACE)
445+ if (SDK_NAME MATCHES "iphone" )
446+ set (CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE} )
447+ endif ()
445448# CMake 3.14+ support building for iOS, watchOS and tvOS out of the box.
446449if (MODERN_CMAKE)
447- if (SDK_NAME MATCHES "iphone" )
448- set (CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE} )
449- elseif (SDK_NAME MATCHES "appletv" )
450+ if (SDK_NAME MATCHES "appletv" )
450451 set (CMAKE_SYSTEM_NAME tvOS CACHE INTERNAL "" ${FORCE_CACHE} )
451452 elseif (SDK_NAME MATCHES "watch" )
452453 set (CMAKE_SYSTEM_NAME watchOS CACHE INTERNAL "" ${FORCE_CACHE} )
453454 endif ()
454-
455455 # Provide flags for a combined FAT library build on newer CMake versions
456456 if (PLATFORM_INT MATCHES ".*COMBINED" )
457457 set (CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH NO CACHE INTERNAL "" ${FORCE_CACHE} )
458458 set (CMAKE_IOS_INSTALL_COMBINED YES CACHE INTERNAL "" ${FORCE_CACHE} )
459459 message (STATUS "Will combine built (static) artifacts into FAT lib..." )
460460 endif ()
461461else ()
462- # Legacy code path prior to CMake 3.14
463- set (CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${FORCE_CACHE} )
462+ # Legacy code path prior to CMake 3.14 or fallback if no SDK_NAME specified
463+ set (CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE} )
464464endif ()
465465# Standard settings.
466466set (CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "" )
@@ -591,6 +591,7 @@ else()
591591 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE} " )
592592 set (CMAKE_C_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS} " )
593593 set (CMAKE_CXX_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS} " )
594+ SET (CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp" )
594595
595596 # In order to ensure that the updated compiler flags are used in try_compile()
596597 # tests, we have to forcibly set them in the CMake cache, not merely set them
0 commit comments