blob: 743e0758bad1f92633a896068fd060d2130c33d8 [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001#----------------------------------------------------------------------------
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
18set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/build_native)
19set(PLAT_HAL ${CMAKE_CURRENT_SOURCE_DIR}/source/application/hal/platforms/native)
20
21if (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)
26endif()
27
28if (DEFINED LOG_LEVEL)
29 message(STATUS "Setting log level to ${LOG_LEVEL}")
30 set (LOG_FLAG "-DLOG_LEVEL=${LOG_LEVEL}")
31endif()
32
33set(TENSORFLOW_LITE_MICRO_PLATFORM_LIB_NAME "libtensorflow-microlite.a")
34set(TENSORFLOW_LITE_MICRO_FLAGS "-DTF_LITE_STATIC_MEMORY -DACTIVATION_BUF_SRAM_SZ=0")
35
36set(CMAKE_C_FLAGS
37 "${WARNING_FLAGS} ${SPECIAL_OPTS} ${PLATFORM_FLAGS}\
38 ${PROFILING_OPT} ${TF_FLAG} ${LOG_FLAG} ${TENSORFLOW_LITE_MICRO_FLAGS}"
39 CACHE INTERNAL "")
40set(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:
47set(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
55file(GLOB_RECURSE SRC_PLAT_HAL
56 "${PLAT_HAL}/**/*.c"
57 "${PLAT_HAL}/**/*.cc"
58 )