blob: 90f4319f56d20c03f1e396b96e865f62540ad6db [file] [log] [blame]
Kristofer Jonsson18239302020-04-17 08:45:38 +02001#
2# Copyright (c) 2019-2020 Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6# Licensed under the Apache License, Version 2.0 (the License); you may
7# not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an AS IS BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19cmake_minimum_required(VERSION 3.15.6)
20
21project(core_software VERSION 0.0.1)
22
23#
24# Define build options
25#
26
27# Setup paths
28set(CMSIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmsis" CACHE PATH "Path to CMSIS.")
29set(CORE_DRIVER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/core_driver" CACHE PATH "Path to core driver.")
30set(TENSORFLOW_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tensorflow" CACHE PATH "Path to Tensorflow.")
31
32# Enable NPU backend
33set(CORE_SOFTWARE_BACKEND "NPU" CACHE STRING "Enable NPU backend. (None, NPU)")
34
35# Define build options
36set(CORE_SOFTWARE_RTOS "None" CACHE STRING "Select RTOS to include. (None, MbedOS, FreeRTOS, Zephyr)")
37
38#
39# Build
40#
41
42# Build CMSIS
43include(cmsis.cmake)
44
45# Build core driver
46set(ETHOSU_PMU_INTERACTIVE OFF)
47add_subdirectory(${CORE_DRIVER_PATH} core_driver)
48
49# Build Tensorflow library
50include(tensorflow.cmake)
51
52# Merge libraries into static library
53add_library(ethosu_core INTERFACE)
54target_link_libraries(ethosu_core INTERFACE tflu cmsis_device ethosu_core_driver)