diff --git a/build/Utils.cmake b/build/Utils.cmake index 246bd68c837..d81a2c8efaf 100644 --- a/build/Utils.cmake +++ b/build/Utils.cmake @@ -196,6 +196,21 @@ function(extract_sources sources_file) message(FATAL_ERROR "Unsupported ANDROID_ABI setting ${ANDROID_ABI}. Please add it here!") endif() endif() + + if(CMAKE_SYSTEM_NAME STREQUAL "iOS") + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(target_platforms_arg "--target-platforms=shim//:ios-arm64") + endif() + endif() + + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(target_platforms_arg "--target-platforms=shim//:macos-arm64") + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(target_platforms_arg "--target-platforms=shim//:macos-x86_64") + endif() + endif() + execute_process( COMMAND ${PYTHON_EXECUTABLE} ${executorch_root}/build/extract_sources.py diff --git a/shim/BUCK b/shim/BUCK index b18ee71454e..fa0d8464b42 100644 --- a/shim/BUCK +++ b/shim/BUCK @@ -74,3 +74,27 @@ execution_platform( use_windows_path_separators = host_info().os.is_windows, visibility = ["PUBLIC"], ) + +execution_platform( + name = "ios-arm64", + cpu_configuration = "prelude//cpu:arm64", + os_configuration = "prelude//os:ios", + use_windows_path_separators = False, + visibility = ["PUBLIC"], +) + +execution_platform( + name = "macos-arm64", + cpu_configuration = "prelude//cpu:arm64", + os_configuration = "prelude//os:macos", + use_windows_path_separators = False, + visibility = ["PUBLIC"], +) + +execution_platform( + name = "macos-x86_64", + cpu_configuration = "prelude//cpu:x86_64", + os_configuration = "prelude//os:macos", + use_windows_path_separators = False, + visibility = ["PUBLIC"], +)