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 | |
| 21 | if (ETHOS_U55_ENABLED) |
| 22 | message(WARNING "EthosU can't be enabled for native builds." |
| 23 | "Use -DETHOS_U55_ENABLED=0 flag for this target platform." |
| 24 | "Overriding, disabling use of EthosU...") |
| 25 | set(ETHOS_U55_ENABLED OFF) |
| 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 | |
| 36 | set(CMAKE_C_FLAGS |
| 37 | "${WARNING_FLAGS} ${SPECIAL_OPTS} ${PLATFORM_FLAGS}\ |
| 38 | ${PROFILING_OPT} ${TF_FLAG} ${LOG_FLAG} ${TENSORFLOW_LITE_MICRO_FLAGS}" |
| 39 | CACHE INTERNAL "") |
| 40 | set(CMAKE_CXX_FLAGS |
| 41 | "${WARNING_FLAGS} ${SPECIAL_OPTS} ${SPECIAL_OPTS_CXX}\ |
| 42 | ${PLATFORM_FLAGS} ${PROFILING_OPT} ${TF_FLAG} ${LOG_FLAG}\ |
| 43 | ${TENSORFLOW_LITE_MICRO_FLAGS}" |
| 44 | CACHE INTERNAL "") |
| 45 | |
| 46 | # Include directories: |
| 47 | set(PLAT_INCLUDE_DIRS |
| 48 | ${PLAT_HAL}/utils/include |
| 49 | ${PLAT_HAL}/images/include |
| 50 | ${PLAT_HAL}/data_presentation/log/include |
| 51 | ${PLAT_HAL}/timer/include |
| 52 | ) |
| 53 | |
| 54 | # Source files |
| 55 | file(GLOB_RECURSE SRC_PLAT_HAL |
| 56 | "${PLAT_HAL}/**/*.c" |
| 57 | "${PLAT_HAL}/**/*.cc" |
| 58 | ) |