alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 1 | #---------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2021 Arm Limited. All rights reserved. |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | #---------------------------------------------------------------------------- |
| 17 | # Set the install prefix |
| 18 | set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/build_native) |
| 19 | set(PLAT_HAL ${CMAKE_CURRENT_SOURCE_DIR}/source/application/hal/platforms/native) |
| 20 | |
Cisco Cervellera | f085fa5 | 2021-08-02 09:32:07 +0100 | [diff] [blame] | 21 | if (ETHOS_U_NPU_ENABLED) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 22 | message(WARNING "EthosU can't be enabled for native builds." |
Kshitij Sisodia | b59ba68 | 2021-11-23 17:19:52 +0000 | [diff] [blame^] | 23 | "Use -DETHOS_U_NPU_ENABLED=OFF flag for this target platform." |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 24 | "Overriding, disabling use of EthosU...") |
Cisco Cervellera | f085fa5 | 2021-08-02 09:32:07 +0100 | [diff] [blame] | 25 | set(ETHOS_U_NPU_ENABLED OFF) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 26 | endif() |
| 27 | |
| 28 | if (DEFINED LOG_LEVEL) |
| 29 | message(STATUS "Setting log level to ${LOG_LEVEL}") |
| 30 | set (LOG_FLAG "-DLOG_LEVEL=${LOG_LEVEL}") |
| 31 | endif() |
| 32 | |
| 33 | set(TENSORFLOW_LITE_MICRO_PLATFORM_LIB_NAME "libtensorflow-microlite.a") |
| 34 | set(TENSORFLOW_LITE_MICRO_FLAGS "-DTF_LITE_STATIC_MEMORY -DACTIVATION_BUF_SRAM_SZ=0") |
| 35 | |
alexander | 80eecfb | 2021-07-06 19:47:59 +0100 | [diff] [blame] | 36 | if (DEFINED VERIFY_TEST_OUTPUT) |
| 37 | message(STATUS "Test output verification flag is: ${VERIFY_TEST_OUTPUT}") |
| 38 | set(PROFILING_OPT "${PROFILING_OPT} -DVERIFY_TEST_OUTPUT=${VERIFY_TEST_OUTPUT}") |
| 39 | endif () |
| 40 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 41 | set(CMAKE_C_FLAGS |
Kshitij Sisodia | f9c19ea | 2021-05-07 16:08:14 +0100 | [diff] [blame] | 42 | "${PROFILING_OPT} ${LOG_FLAG} ${TENSORFLOW_LITE_MICRO_FLAGS}" |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 43 | CACHE INTERNAL "") |
Kshitij Sisodia | f9c19ea | 2021-05-07 16:08:14 +0100 | [diff] [blame] | 44 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 45 | set(CMAKE_CXX_FLAGS |
Kshitij Sisodia | f9c19ea | 2021-05-07 16:08:14 +0100 | [diff] [blame] | 46 | "${PROFILING_OPT} ${LOG_FLAG} ${TENSORFLOW_LITE_MICRO_FLAGS}" |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 47 | CACHE INTERNAL "") |
| 48 | |
| 49 | # Include directories: |
| 50 | set(PLAT_INCLUDE_DIRS |
| 51 | ${PLAT_HAL}/utils/include |
| 52 | ${PLAT_HAL}/images/include |
| 53 | ${PLAT_HAL}/data_presentation/log/include |
| 54 | ${PLAT_HAL}/timer/include |
| 55 | ) |
| 56 | |
| 57 | # Source files |
| 58 | file(GLOB_RECURSE SRC_PLAT_HAL |
| 59 | "${PLAT_HAL}/**/*.c" |
| 60 | "${PLAT_HAL}/**/*.cc" |
| 61 | ) |