diff --git a/backends/arm/CMakeLists.txt b/backends/arm/CMakeLists.txt index 11f61c0dfee..3830a1b1108 100644 --- a/backends/arm/CMakeLists.txt +++ b/backends/arm/CMakeLists.txt @@ -14,7 +14,9 @@ endif() include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake) -set(_common_include_directories ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10) +set(_common_include_directories + ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10 +) add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS) @@ -34,13 +36,12 @@ set(_arm_baremetal_sources backends/arm/runtime/EthosUBackend.cpp list(TRANSFORM _arm_baremetal_sources PREPEND "${EXECUTORCH_ROOT}/") add_library(executorch_delegate_ethos_u STATIC ${_arm_baremetal_sources}) -target_include_directories( - executorch_delegate_ethos_u PUBLIC ${_common_include_directories} -) -target_include_directories( - executorch_delegate_ethos_u PUBLIC ${DRIVER_ETHOSU_INCLUDE_DIR} +target_link_libraries( + executorch_delegate_ethos_u PUBLIC executorch_core ethosu_core_driver ) +install(TARGETS executorch_delegate_ethos_u EXPORT ExecuTorchTargets) + # end config for bare metal builds endif() diff --git a/examples/arm/executor_runner/CMakeLists.txt b/examples/arm/executor_runner/CMakeLists.txt index beb902652ad..0db57e9d15a 100644 --- a/examples/arm/executor_runner/CMakeLists.txt +++ b/examples/arm/executor_runner/CMakeLists.txt @@ -111,50 +111,16 @@ add_corstone_subdirectory(${SYSTEM_CONFIG} ${ETHOS_SDK_PATH}) configure_timing_adapters(${SYSTEM_CONFIG} ${MEMORY_MODE}) # Dependencies from the ExecuTorch build -add_library(executorch STATIC IMPORTED) -set_property( - TARGET executorch PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/libexecutorch.a" -) - -add_library(executorch_core STATIC IMPORTED) -set_property( - TARGET executorch_core PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/libexecutorch_core.a" +find_package( + executorch REQUIRED HINTS "${ET_BUILD_DIR_PATH}/lib/cmake/ExecuTorch" ) -target_link_libraries(executorch INTERFACE executorch_core) -add_library(executorch_delegate_ethos_u STATIC IMPORTED) +add_library(arm_portable_ops_lib STATIC IMPORTED) set_property( - TARGET executorch_delegate_ethos_u - PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/backends/arm/libexecutorch_delegate_ethos_u.a" -) - -add_library(portable_ops_lib STATIC IMPORTED) -set_property( - TARGET portable_ops_lib + TARGET arm_portable_ops_lib PROPERTY IMPORTED_LOCATION "${ET_BUILD_DIR_PATH}/examples/arm/libarm_portable_ops_lib.a" ) -add_library(portable_kernels STATIC IMPORTED) -set_property( - TARGET portable_kernels - PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/kernels/portable/libportable_kernels.a" -) -add_library(quantized_ops_lib STATIC IMPORTED) -set_property( - TARGET quantized_ops_lib - PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/kernels/quantized/libquantized_ops_lib.a" -) -add_library(quantized_kernels STATIC IMPORTED) -set_property( - TARGET quantized_kernels - PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/kernels/quantized/libquantized_kernels.a" -) add_library(cortex_m_ops_lib STATIC IMPORTED) set_property( TARGET cortex_m_ops_lib @@ -167,13 +133,6 @@ set_property( PROPERTY IMPORTED_LOCATION "${ET_BUILD_DIR_PATH}/backends/cortex_m/libcortex_m_kernels.a" ) -add_library(extension_runner_util STATIC IMPORTED) -set_property( - TARGET extension_runner_util - PROPERTY - IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/extension/runner_util/libextension_runner_util.a" -) # Convert pte to header if(NOT ${SEMIHOSTING}) @@ -208,11 +167,11 @@ list( extension_runner_util ethosu_target_init executorch + quantized_ops_lib "-Wl,--whole-archive" executorch_delegate_ethos_u cortex_m_ops_lib - quantized_ops_lib - portable_ops_lib + arm_portable_ops_lib quantized_kernels cortex_m_kernels portable_kernels @@ -224,27 +183,10 @@ list( if(EXECUTORCH_ENABLE_EVENT_TRACER) target_compile_options(arm_executor_runner PUBLIC -DET_EVENT_TRACER_ENABLED) - add_library(etdump STATIC IMPORTED) - set_property( - TARGET etdump PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/lib/libetdump.a" - ) - - add_library(flatccrt STATIC IMPORTED) - set_property( - TARGET flatccrt PROPERTY IMPORTED_LOCATION - "${ET_BUILD_DIR_PATH}/lib/libflatccrt.a" - ) - list(APPEND arm_executor_runner_link etdump flatccrt) endif() if(ET_BUNDLE_IO) - add_library(bundled_program STATIC IMPORTED) - set_property( - TARGET bundled_program - PROPERTY IMPORTED_LOCATION "${ET_BUILD_DIR_PATH}/lib/libbundled_program.a" - ) list(APPEND arm_executor_runner_link bundled_program) endif()