|
|
@@ -1,8 +1,8 @@
|
|
|
include(RunCMake)
|
|
|
|
|
|
-function(create_library type platform system_name archs)
|
|
|
+function(create_library type platform system_name archs sysroot)
|
|
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/create-${type}-${platform}-build)
|
|
|
- run_cmake_with_options(create-${type}-${platform} -DCMAKE_SYSTEM_NAME=${system_name} -DCMAKE_OSX_ARCHITECTURES=${archs} -DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install)
|
|
|
+ run_cmake_with_options(create-${type}-${platform} -DCMAKE_SYSTEM_NAME=${system_name} -DCMAKE_OSX_ARCHITECTURES=${archs} -DCMAKE_OSX_SYSROOT=${sysroot} -DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install)
|
|
|
|
|
|
set(RunCMake_TEST_NO_CLEAN 1)
|
|
|
run_cmake_command(create-${type}-${platform}-build ${CMAKE_COMMAND} --build . --config Release)
|
|
|
@@ -10,12 +10,18 @@ function(create_library type platform system_name archs)
|
|
|
endfunction()
|
|
|
|
|
|
function(create_libraries type)
|
|
|
- create_library(${type} macos Darwin "${macos_archs_2}")
|
|
|
- create_library(${type} ios iOS "arm64")
|
|
|
- create_library(${type} tvos tvOS "arm64")
|
|
|
- create_library(${type} watchos watchOS "armv7k\\\\;arm64_32")
|
|
|
+ create_library(${type} macos Darwin "${macos_archs_2}" macosx)
|
|
|
+ create_library(${type} ios iOS "arm64" iphoneos)
|
|
|
+ create_library(${type} tvos tvOS "arm64" appletvos)
|
|
|
+ create_library(${type} watchos watchOS "armv7k\\\\;arm64_32" watchos)
|
|
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
|
|
|
- create_library(${type} visionos visionOS "arm64")
|
|
|
+ create_library(${type} visionos visionOS "arm64" xros)
|
|
|
+ endif()
|
|
|
+ create_library(${type} ios-simulator iOS "${macos_archs_2}" iphonesimulator)
|
|
|
+ create_library(${type} tvos-simulator tvOS "${macos_archs_2}" appletvsimulator)
|
|
|
+ create_library(${type} watchos-simulator watchOS "${watch_sim_archs_2}" watchsimulator)
|
|
|
+ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
|
|
|
+ create_library(${type} visionos-simulator visionOS "${macos_archs_2}" xrsimulator)
|
|
|
endif()
|
|
|
endfunction()
|
|
|
|
|
|
@@ -32,34 +38,42 @@ function(create_xcframework name type platforms)
|
|
|
run_cmake_command(create-xcframework-${name} xcodebuild -create-xcframework ${args} -output ${RunCMake_TEST_BINARY_DIR}/mylib.xcframework)
|
|
|
endfunction()
|
|
|
|
|
|
-function(create_executable name xcfname system_name archs)
|
|
|
+function(create_executable name xcfname system_name archs sysroot)
|
|
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/create-executable-${name}-build)
|
|
|
- run_cmake_with_options(create-executable-${name} -DCMAKE_SYSTEM_NAME=${system_name} -DCMAKE_OSX_ARCHITECTURES=${archs} -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-${xcfname}-build/mylib.xcframework)
|
|
|
+ run_cmake_with_options(create-executable-${name} -DCMAKE_SYSTEM_NAME=${system_name} -DCMAKE_OSX_ARCHITECTURES=${archs} -DCMAKE_OSX_SYSROOT=${sysroot} -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-${xcfname}-build/mylib.xcframework)
|
|
|
|
|
|
set(RunCMake_TEST_NO_CLEAN 1)
|
|
|
run_cmake_command(create-executable-${name}-build ${CMAKE_COMMAND} --build . --config Release)
|
|
|
endfunction()
|
|
|
|
|
|
function(create_executables name type)
|
|
|
- create_executable(${name}-macos ${type} Darwin "${macos_archs_2}")
|
|
|
- create_executable(${name}-ios ${type} iOS "arm64")
|
|
|
- create_executable(${name}-tvos ${type} tvOS "arm64")
|
|
|
- create_executable(${name}-watchos ${type} watchOS "armv7k\\\\;arm64_32")
|
|
|
+ create_executable(${name}-macos ${type} Darwin "${macos_archs_2}" macosx)
|
|
|
+ create_executable(${name}-ios ${type} iOS "arm64" iphoneos)
|
|
|
+ create_executable(${name}-tvos ${type} tvOS "arm64" appletvos)
|
|
|
+ create_executable(${name}-watchos ${type} watchOS "armv7k\\\\;arm64_32" watchos)
|
|
|
+ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
|
|
|
+ create_executable(${name}-visionos ${type} visionOS "arm64" xros)
|
|
|
+ endif()
|
|
|
+ create_executable(${name}-ios-simulator ${type} iOS "${macos_archs_2}" iphonesimulator)
|
|
|
+ create_executable(${name}-tvos-simulator ${type} tvOS "${macos_archs_2}" appletvsimulator)
|
|
|
+ create_executable(${name}-watchos-simulator ${type} watchOS "${watch_sim_archs_2}" watchsimulator)
|
|
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
|
|
|
- create_executable(${name}-visionos ${type} visionOS "arm64")
|
|
|
+ create_executable(${name}-visionos-simulator ${type} visionOS "${macos_archs_2}" xrsimulator)
|
|
|
endif()
|
|
|
endfunction()
|
|
|
|
|
|
-set(xcframework_platforms macos ios tvos watchos)
|
|
|
+set(xcframework_platforms macos ios tvos watchos ios-simulator tvos-simulator watchos-simulator)
|
|
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
|
|
|
- list(APPEND xcframework_platforms visionos)
|
|
|
+ list(APPEND xcframework_platforms visionos visionos-simulator)
|
|
|
endif()
|
|
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
|
|
set(macos_archs_1 "x86_64\\;arm64")
|
|
|
set(macos_archs_2 "x86_64\\\\;arm64")
|
|
|
+ set(watch_sim_archs_2 "x86_64")
|
|
|
else()
|
|
|
set(macos_archs_1 "x86_64")
|
|
|
set(macos_archs_2 "x86_64")
|
|
|
+ set(watch_sim_archs_2 "i386")
|
|
|
endif()
|
|
|
|
|
|
create_libraries(library)
|