diff options
-rw-r--r-- | applications/baremetal/CMakeLists.txt | 8 | ||||
-rw-r--r-- | applications/baremetal/main.cpp | 4 | ||||
-rw-r--r-- | applications/driver_unit_tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | applications/freertos/CMakeLists.txt | 2 | ||||
-rw-r--r-- | applications/trustzone_inference/CMakeLists.txt | 2 |
5 files changed, 13 insertions, 7 deletions
diff --git a/applications/baremetal/CMakeLists.txt b/applications/baremetal/CMakeLists.txt index c0ecf03..37073bb 100644 --- a/applications/baremetal/CMakeLists.txt +++ b/applications/baremetal/CMakeLists.txt @@ -21,16 +21,18 @@ set(BAREMETAL_PATH "" CACHE PATH "Path to input, output and network for baremeta if (IS_DIRECTORY ${BAREMETAL_PATH}) ethosu_add_executable_test(baremetal_custom PRIVATE SOURCES main.cpp - LIBRARIES ethosu_monitor) + LIBRARIES $<$<TARGET_EXISTS:ethosu_monitor>:ethosu_monitor>) target_include_directories(baremetal_custom PRIVATE ${BAREMETAL_PATH}) endif() -file(GLOB models LIST_DIRECTORIES true "${CMAKE_CURRENT_SOURCE_DIR}/models/${ETHOSU_TARGET_NPU_CONFIG}/*") +if (TARGET ethosu_core_driver) + file(GLOB models LIST_DIRECTORIES true "${CMAKE_CURRENT_SOURCE_DIR}/models/${ETHOSU_TARGET_NPU_CONFIG}/*") +endif() foreach(model ${models}) get_filename_component(name ${model} NAME) ethosu_add_executable_test(baremetal_${name} PRIVATE SOURCES main.cpp - LIBRARIES ethosu_monitor) + LIBRARIES $<$<TARGET_EXISTS:ethosu_monitor>:ethosu_monitor>) target_include_directories(baremetal_${name} PRIVATE ${model}) endforeach()
\ No newline at end of file diff --git a/applications/baremetal/main.cpp b/applications/baremetal/main.cpp index e394e3a..ea5f03c 100644 --- a/applications/baremetal/main.cpp +++ b/applications/baremetal/main.cpp @@ -20,10 +20,9 @@ * Includes ****************************************************************************/ -// NPU driver -#include "ethosu_driver.h" // Inference process #include "inference_process.hpp" + // System includes #include <stdio.h> #include <vector> @@ -34,6 +33,7 @@ #include "output.h" #ifdef ETHOSU +#include <ethosu_driver.h> #include <ethosu_monitor.hpp> #include <pmu_ethosu.h> #endif diff --git a/applications/driver_unit_tests/CMakeLists.txt b/applications/driver_unit_tests/CMakeLists.txt index 45c733b..aee3025 100644 --- a/applications/driver_unit_tests/CMakeLists.txt +++ b/applications/driver_unit_tests/CMakeLists.txt @@ -16,6 +16,10 @@ # limitations under the License. # +if (NOT TARGET ethosu_core_driver) + return() +endif() + add_library(driver_unit INTERFACE) target_sources(driver_unit INTERFACE diff --git a/applications/freertos/CMakeLists.txt b/applications/freertos/CMakeLists.txt index 8be3b3a..610f0e5 100644 --- a/applications/freertos/CMakeLists.txt +++ b/applications/freertos/CMakeLists.txt @@ -17,7 +17,7 @@ # # Exclude this app if freertos target does not exist or if NPU configuration is not H128 -if (NOT TARGET freertos_kernel OR NOT ETHOSU_TARGET_NPU_CONFIG STREQUAL "ethos-u55-128") +if (NOT TARGET freertos_kernel OR NOT TARGET ethosu_core_driver OR NOT ETHOSU_TARGET_NPU_CONFIG STREQUAL "ethos-u55-128") message("Skipping FreeRTOS application") return() endif() diff --git a/applications/trustzone_inference/CMakeLists.txt b/applications/trustzone_inference/CMakeLists.txt index f1efa95..a985437 100644 --- a/applications/trustzone_inference/CMakeLists.txt +++ b/applications/trustzone_inference/CMakeLists.txt @@ -16,7 +16,7 @@ # limitations under the License. # -if (NOT ${ETHOSU_TARGET} STREQUAL "corstone-300") +if (NOT ${ETHOSU_TARGET} STREQUAL "corstone-300" OR NOT TARGET ethosu_core_driver) return() endif() |