blob: 6ebf4352b02ed2d8eea8057cbf02e4c3565e8d72 [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
Cisco Cervelleraf085fa52021-08-02 09:32:07 +010021if (ETHOS_U_NPU_ENABLED)
alexander3c798932021-03-26 21:42:19 +000022 message(WARNING "EthosU can't be enabled for native builds."
Kshitij Sisodiab59ba682021-11-23 17:19:52 +000023 "Use -DETHOS_U_NPU_ENABLED=OFF flag for this target platform."
alexander3c798932021-03-26 21:42:19 +000024 "Overriding, disabling use of EthosU...")
Cisco Cervelleraf085fa52021-08-02 09:32:07 +010025 set(ETHOS_U_NPU_ENABLED OFF)
alexander3c798932021-03-26 21:42:19 +000026endif()
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
alexander80eecfb2021-07-06 19:47:59 +010036if (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}")
39endif ()
40
alexander3c798932021-03-26 21:42:19 +000041set(CMAKE_C_FLAGS
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010042 "${PROFILING_OPT} ${LOG_FLAG} ${TENSORFLOW_LITE_MICRO_FLAGS}"
alexander3c798932021-03-26 21:42:19 +000043 CACHE INTERNAL "")
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010044
alexander3c798932021-03-26 21:42:19 +000045set(CMAKE_CXX_FLAGS
Kshitij Sisodiaf9c19ea2021-05-07 16:08:14 +010046 "${PROFILING_OPT} ${LOG_FLAG} ${TENSORFLOW_LITE_MICRO_FLAGS}"
alexander3c798932021-03-26 21:42:19 +000047 CACHE INTERNAL "")
48
49# Include directories:
50set(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
58file(GLOB_RECURSE SRC_PLAT_HAL
59 "${PLAT_HAL}/**/*.c"
60 "${PLAT_HAL}/**/*.cc"
61 )