diff --git a/.github/workflows/app-build.yml b/.github/workflows/app-build.yml index c328b105d0..6a5b02b4fc 100644 --- a/.github/workflows/app-build.yml +++ b/.github/workflows/app-build.yml @@ -14,6 +14,7 @@ on: - build/build_apple_frameworks.sh - build/test_ios_ci.sh - examples/demo-apps/** + - extension/module/** workflow_dispatch: concurrency: diff --git a/build/executorch-config.cmake b/build/executorch-config.cmake index 4becfbf8a4..c82933f33f 100644 --- a/build/executorch-config.cmake +++ b/build/executorch-config.cmake @@ -53,9 +53,12 @@ foreach(lib ${lib_list}) message("${lib} library is not found. If needed rebuild with the proper options in CMakeLists.txt") else() - if("${lib}" STREQUAL "extension_module") + if("${lib}" STREQUAL "extension_module" AND (NOT CMAKE_TOOLCHAIN_IOS)) add_library(${lib} SHARED IMPORTED) else() + # Building a share library on iOS requires code signing, so it's + # easier to keep all libs as static when CMAKE_TOOLCHAIN_IOS is + # used add_library(${lib} STATIC IMPORTED) endif() set_target_properties( diff --git a/extension/module/CMakeLists.txt b/extension/module/CMakeLists.txt index aa75b1bf8e..af6200cc7a 100644 --- a/extension/module/CMakeLists.txt +++ b/extension/module/CMakeLists.txt @@ -17,7 +17,12 @@ if(NOT EXECUTORCH_ROOT) endif() list(TRANSFORM _extension_module__srcs PREPEND "${EXECUTORCH_ROOT}/") -add_library(extension_module SHARED ${_extension_module__srcs}) +if(CMAKE_TOOLCHAIN_IOS) + # Building a share library on iOS requires code signing + add_library(extension_module STATIC ${_extension_module__srcs}) +else() + add_library(extension_module SHARED ${_extension_module__srcs}) +endif() target_link_libraries(extension_module PRIVATE executorch) target_include_directories(extension_module PUBLIC ${EXECUTORCH_ROOT}/..) target_compile_options(extension_module PUBLIC -Wno-deprecated-declarations