alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 1 | #---------------------------------------------------------------------------- |
Kshitij Sisodia | 26bc923 | 2023-03-10 16:33:23 +0000 | [diff] [blame] | 2 | # SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 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 | #---------------------------------------------------------------------------- |
Kshitij Sisodia | 9c6f9f8 | 2022-05-20 14:30:02 +0100 | [diff] [blame] | 17 | cmake_minimum_required(VERSION 3.21.0) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 18 | |
| 19 | # Build in release mode by default |
| 20 | if (NOT CMAKE_BUILD_TYPE STREQUAL Debug) |
| 21 | set(CMAKE_BUILD_TYPE Release CACHE INTERNAL "") |
| 22 | endif() |
| 23 | |
| 24 | message(STATUS "Build type is set to ${CMAKE_BUILD_TYPE}") |
| 25 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 26 | # Set language standards. |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 27 | set(CMAKE_C_STANDARD 99) |
ayamas01 | 15f8070 | 2021-11-18 14:22:23 +0000 | [diff] [blame] | 28 | set(CMAKE_CXX_STANDARD 14) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 29 | |
| 30 | # Make the standard a requirement => prevent fallback to previous |
| 31 | # supported standard |
| 32 | set(CMAKE_C_STANDARD_REQUIRED ON) |
| 33 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 34 | |
| 35 | # We want to pass standard C/C++ flags, without gnu extensions |
| 36 | set(CMAKE_C_EXTENSIONS OFF) |
| 37 | set(CMAKE_CXX_EXTENSIONS OFF) |
| 38 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 39 | set(SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scripts) |
| 40 | set(CMAKE_SCRIPTS_DIR ${SCRIPTS_DIR}/cmake) |
| 41 | set(CMAKE_TOOLCHAIN_DIR ${CMAKE_SCRIPTS_DIR}/toolchains) |
Kshitij Sisodia | f9c19ea | 2021-05-07 16:08:14 +0100 | [diff] [blame] | 42 | set(DOWNLOAD_DEP_DIR ${CMAKE_BINARY_DIR}/dependencies) |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 43 | set(DEPENDENCY_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dependencies) |
Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 44 | set(CORE_PLATFORM_DIR ${DEPENDENCY_ROOT_DIR}/core-platform) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 45 | |
Kshitij Sisodia | ddcb56d | 2021-05-11 14:46:01 +0100 | [diff] [blame] | 46 | set(RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources_downloaded |
| 47 | CACHE PATH "Resources directory") |
Kshitij Sisodia | c22e80e | 2022-03-14 09:26:48 +0000 | [diff] [blame] | 48 | set(HAL_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source/hal/source/platform) |
Kshitij Sisodia | ddcb56d | 2021-05-11 14:46:01 +0100 | [diff] [blame] | 49 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 50 | include(${CMAKE_SCRIPTS_DIR}/source_gen_utils.cmake) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 51 | |
Eanna O Cathain | 7bc6832 | 2022-05-31 14:14:32 +0100 | [diff] [blame] | 52 | enable_testing() |
| 53 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 54 | if (${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) |
| 55 | message(FATAL_ERROR "Source and build are in the same directory") |
| 56 | else() |
| 57 | message(STATUS "Source directory: ${CMAKE_SOURCE_DIR}") |
| 58 | message(STATUS "Binary directory: ${CMAKE_BINARY_DIR}") |
| 59 | endif() |
| 60 | |
Kshitij Sisodia | b59ba68 | 2021-11-23 17:19:52 +0000 | [diff] [blame] | 61 | include(${CMAKE_SCRIPTS_DIR}/common_user_options.cmake) |
alexander | cb8a987 | 2022-02-11 13:23:22 +0000 | [diff] [blame] | 62 | |
Isabella Gottardi | ef2b9dd | 2022-02-16 14:24:03 +0000 | [diff] [blame] | 63 | # Check if the resources_downloaded needs update |
| 64 | check_update_public_resources(${RESOURCES_DIR}) |
| 65 | |
alexander | cb8a987 | 2022-02-11 13:23:22 +0000 | [diff] [blame] | 66 | add_platform_build_configuration(TARGET_PLATFORM ${TARGET_PLATFORM}) |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 67 | |
| 68 | set_platform_global_defaults() |
| 69 | |
| 70 | message(STATUS "Using CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}") |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 71 | |
Kshitij Sisodia | b59ba68 | 2021-11-23 17:19:52 +0000 | [diff] [blame] | 72 | # Make sure the following options are defined before proceeding: |
| 73 | assert_defined(LOG_LEVEL) |
| 74 | assert_defined(TENSORFLOW_SRC_PATH) |
| 75 | assert_defined(TARGET_PLATFORM) |
| 76 | assert_defined(TARGET_SUBSYSTEM) |
| 77 | assert_defined(ETHOS_U_NPU_ENABLED) |
| 78 | assert_defined(USE_CASE_BUILD) |
| 79 | assert_defined(CPU_PROFILE_ENABLED) |
| 80 | assert_defined(CMAKE_TOOLCHAIN_FILE) |
Kshitij Sisodia | f9c19ea | 2021-05-07 16:08:14 +0100 | [diff] [blame] | 81 | |
Nina Drozd | 5916952 | 2022-02-10 13:33:20 +0000 | [diff] [blame] | 82 | if(POLICY CMP0123) |
| 83 | cmake_policy(SET CMP0123 NEW) |
| 84 | endif() |
| 85 | |
Kshitij Sisodia | f9c19ea | 2021-05-07 16:08:14 +0100 | [diff] [blame] | 86 | project(arm_ml_embedded_evaluation_kit |
Richard Burton | 49482d5 | 2023-11-30 11:38:45 +0000 | [diff] [blame] | 87 | VERSION 23.11.0 |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 88 | DESCRIPTION "ARM ML Embedded Evaluation Kit" |
| 89 | LANGUAGES C CXX ASM) |
Kshitij Sisodia | f9c19ea | 2021-05-07 16:08:14 +0100 | [diff] [blame] | 90 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 91 | enforce_compiler_version() |
| 92 | setup_source_generator() |
| 93 | |
| 94 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
| 95 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
| 96 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 97 | set(SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/source) |
Isabella Gottardi | 8520983 | 2021-04-20 14:08:52 +0100 | [diff] [blame] | 98 | set(TEST_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 99 | list(APPEND USE_CASES_TESTS_SEARCH_DIR_LIST ${TEST_SRCS}/use_case) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 100 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 101 | # We include log target |
| 102 | add_subdirectory(${SRC_PATH}/log ${CMAKE_BINARY_DIR}/log) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 103 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 104 | # We include arm_math target |
| 105 | add_subdirectory(${SRC_PATH}/math ${CMAKE_BINARY_DIR}/math) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 106 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 107 | # We include the hal target |
| 108 | add_subdirectory(${SRC_PATH}/hal ${CMAKE_BINARY_DIR}/hal) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 109 | |
Kshitij Sisodia | e2da7ee | 2022-02-14 11:22:58 +0000 | [diff] [blame] | 110 | # Add the profiler target |
| 111 | if (NOT DEFINED PROFILER_DIR) |
| 112 | set(PROFILER_DIR ${SRC_PATH}/profiler) |
| 113 | endif () |
| 114 | add_subdirectory(${PROFILER_DIR} ${CMAKE_BINARY_DIR}/profiler) |
| 115 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 116 | # Include the tensorflow build target |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 117 | include(${CMAKE_SCRIPTS_DIR}/tensorflow.cmake) |
| 118 | |
Kshitij Sisodia | aa4bcb1 | 2022-05-06 09:13:03 +0100 | [diff] [blame] | 119 | # Add the common API library target (tensorflow-lite-micro target is needed) |
| 120 | add_subdirectory(${SRC_PATH}/application/api/common ${CMAKE_BINARY_DIR}/api/common) |
| 121 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 122 | # Include directories for application module: |
| 123 | set(APPLICATION_INCLUDE_DIRS |
Kshitij Sisodia | e2da7ee | 2022-02-14 11:22:58 +0000 | [diff] [blame] | 124 | ${SRC_PATH}/application/main/include) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 125 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 126 | # Source files for application module: |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 127 | file(GLOB_RECURSE SRC_APPLICATION |
| 128 | "${SRC_PATH}/application/main/*.cc" |
| 129 | "${SRC_PATH}/application/main/*.cpp" |
| 130 | "${SRC_PATH}/application/main/*.c" |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 131 | ) |
| 132 | list(FILTER SRC_APPLICATION EXCLUDE REGEX ".*main\\.c.*$") |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 133 | set(SRC_MAIN "${SRC_PATH}/application/main/Main.cc") |
| 134 | set_source_files_properties(${SRC_MAIN} |
| 135 | PROPERTIES COMPILE_DEFINITIONS |
| 136 | "PRJ_VER_STR=\"${PROJECT_VERSION}\";PRJ_DES_STR=\"${PROJECT_DESCRIPTION}\"") |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 137 | |
| 138 | list(JOIN USE_CASE_BUILD "" USE_CASE_BUILD_STR) |
Isabella Gottardi | 8520983 | 2021-04-20 14:08:52 +0100 | [diff] [blame] | 139 | list(APPEND USE_CASES_SEARCH_DIR_LIST ${SRC_PATH}/use_case) |
| 140 | message(STATUS "Use-cases source paths: ${USE_CASES_SEARCH_DIR_LIST}.") |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 141 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 142 | if (${USE_CASE_BUILD_STR} STREQUAL all) |
Isabella Gottardi | 8520983 | 2021-04-20 14:08:52 +0100 | [diff] [blame] | 143 | foreach(USE_CASES_SEARCH_DIR ${USE_CASES_SEARCH_DIR_LIST}) |
| 144 | SUBDIRLIST(USE_CASES_SUBDIRS ${USE_CASES_SEARCH_DIR}) |
| 145 | list(APPEND USE_CASES ${USE_CASES_SUBDIRS}) |
| 146 | endforeach() |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 147 | else() |
| 148 | set(USE_CASES ${USE_CASE_BUILD}) |
| 149 | endif() |
| 150 | |
alexander | cb8a987 | 2022-02-11 13:23:22 +0000 | [diff] [blame] | 151 | list(REMOVE_ITEM USE_CASES "" ${EXCLUDED_USE_CASES}) |
| 152 | message(STATUS "Use-cases excluded by platform configuration: ${EXCLUDED_USE_CASES}") |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 153 | message(STATUS "Building use-cases: ${USE_CASES}.") |
Eanna O Cathain | 7bc6832 | 2022-05-31 14:14:32 +0100 | [diff] [blame] | 154 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 155 | foreach(use_case ${USE_CASES}) |
| 156 | |
Isabella Gottardi | 8520983 | 2021-04-20 14:08:52 +0100 | [diff] [blame] | 157 | set(SRC_USE_CASE "") |
| 158 | foreach(USE_CASES_SEARCH_DIR ${USE_CASES_SEARCH_DIR_LIST}) |
| 159 | if (EXISTS ${USE_CASES_SEARCH_DIR}/${use_case}) |
| 160 | message(STATUS "Found sources for use-case ${use_case}") |
| 161 | set(SRC_USE_CASE ${USE_CASES_SEARCH_DIR}) |
| 162 | break() |
| 163 | endif () |
| 164 | endforeach() |
| 165 | |
| 166 | if (${SRC_USE_CASE} STREQUAL "") |
| 167 | message(FATAL_ERROR "Failed to find sources for ${use_case}!") |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 168 | endif () |
Kshitij Sisodia | 661959c | 2021-11-24 10:39:52 +0000 | [diff] [blame] | 169 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 170 | # Executable application: |
| 171 | set(TARGET_NAME "ethos-u-${use_case}") |
| 172 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 173 | set(DEFAULT_MODEL_DIR ${RESOURCES_DIR}/${use_case}) |
| 174 | set(DEFAULT_TEST_DATA_DIR ${DEFAULT_MODEL_DIR}) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 175 | set(SRC_GEN_DIR ${CMAKE_BINARY_DIR}/generated/${use_case}/src) |
| 176 | set(INC_GEN_DIR ${CMAKE_BINARY_DIR}/generated/${use_case}/include) |
| 177 | |
| 178 | # Remove old files and recreate dirs |
| 179 | file(REMOVE_RECURSE ${SRC_GEN_DIR} ${INC_GEN_DIR}) |
| 180 | file(MAKE_DIRECTORY ${SRC_GEN_DIR} ${INC_GEN_DIR}) |
| 181 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 182 | file(GLOB UC_CMAKE_FILE |
| 183 | "${SRC_USE_CASE}/${use_case}/*.cmake") |
| 184 | |
Kshitij Sisodia | aa4bcb1 | 2022-05-06 09:13:03 +0100 | [diff] [blame] | 185 | # Include the use case cmake file. |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 186 | include(${UC_CMAKE_FILE}) |
| 187 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 188 | file(GLOB_RECURSE UC_SRC |
Isabella Gottardi | 8520983 | 2021-04-20 14:08:52 +0100 | [diff] [blame] | 189 | "${SRC_USE_CASE}/${use_case}/src/*.cpp" |
| 190 | "${SRC_USE_CASE}/${use_case}/src/*.cc" |
| 191 | "${SRC_USE_CASE}/${use_case}/src/*.c" |
| 192 | "${SRC_USE_CASE}/${use_case}/src/**/*.cpp" |
| 193 | "${SRC_USE_CASE}/${use_case}/src/**/*.cc" |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 194 | "${SRC_USE_CASE}/${use_case}/src/**/*.c") |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 195 | |
| 196 | file(GLOB_RECURSE SRC_GEN |
| 197 | "${SRC_GEN_DIR}/*.cc" |
| 198 | "${SRC_GEN_DIR}/*.cpp" |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 199 | "${SRC_GEN_DIR}/*.c") |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 200 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 201 | set(UC_INCLUDE ${SRC_USE_CASE}/${use_case}/include) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 202 | |
Kshitij Sisodia | aa5e1f6 | 2021-09-24 14:42:08 +0100 | [diff] [blame] | 203 | if (DEFINED ${use_case}_COMPILE_DEFS) |
| 204 | message(STATUS "Additional compilation flags for ${use_case}: ${${use_case}_COMPILE_DEFS}") |
| 205 | set_source_files_properties(${UC_SRC} |
| 206 | PROPERTIES COMPILE_DEFINITIONS |
| 207 | "${${use_case}_COMPILE_DEFS}") |
| 208 | endif() |
| 209 | |
Kshitij Sisodia | aa4bcb1 | 2022-05-06 09:13:03 +0100 | [diff] [blame] | 210 | set(UC_LIB_NAME ${use_case}) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 211 | |
| 212 | # Consolidated application static lib: |
| 213 | add_library(${UC_LIB_NAME} STATIC |
| 214 | ${SRC_APPLICATION} |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 215 | ${UC_SRC} |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 216 | ${SRC_GEN}) |
| 217 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 218 | target_include_directories(${UC_LIB_NAME} PUBLIC |
| 219 | ${APPLICATION_INCLUDE_DIRS} |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 220 | ${UC_INCLUDE} |
Kshitij Sisodia | aa4bcb1 | 2022-05-06 09:13:03 +0100 | [diff] [blame] | 221 | ${INC_GEN_DIR}) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 222 | |
| 223 | # Set the activation buffer size |
| 224 | target_compile_definitions(${UC_LIB_NAME} PUBLIC |
Kshitij Sisodia | aa4bcb1 | 2022-05-06 09:13:03 +0100 | [diff] [blame] | 225 | "ACTIVATION_BUF_SZ=${${use_case}_ACTIVATION_BUF_SZ}") |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 226 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 227 | target_link_libraries(${UC_LIB_NAME} PUBLIC |
| 228 | log |
| 229 | arm_math |
| 230 | hal |
Kshitij Sisodia | e2da7ee | 2022-02-14 11:22:58 +0000 | [diff] [blame] | 231 | profiler |
Kshitij Sisodia | 9c6f9f8 | 2022-05-20 14:30:02 +0100 | [diff] [blame] | 232 | tensorflow-lite-micro |
| 233 | common_api) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 234 | |
Kshitij Sisodia | aa4bcb1 | 2022-05-06 09:13:03 +0100 | [diff] [blame] | 235 | # If an API exists for this use case, include the projects here and add to |
| 236 | # the library list. |
| 237 | foreach(API_TO_USE ${${use_case}_API_LIST}) |
| 238 | |
| 239 | # If the required target doesn't yet exist, include the project here: |
| 240 | if (NOT TARGET ${API_TO_USE}_api) |
| 241 | add_subdirectory( |
| 242 | ${SRC_PATH}/application/api/use_case/${API_TO_USE} # Source path |
Isabella Gottardi | 8ce2be8 | 2023-03-20 15:35:42 +0000 | [diff] [blame] | 243 | ${CMAKE_BINARY_DIR}/api/use_case/${API_TO_USE}) # Binary path |
Kshitij Sisodia | aa4bcb1 | 2022-05-06 09:13:03 +0100 | [diff] [blame] | 244 | endif() |
| 245 | |
| 246 | # Check if the target now exists |
| 247 | if (TARGET ${API_TO_USE}_api) |
| 248 | message(STATUS "Using ${API_TO_USE}_api for ${use_case}") |
| 249 | target_link_libraries(${UC_LIB_NAME} PUBLIC ${API_TO_USE}_api) |
| 250 | else() |
| 251 | message(FATAL_ERROR "${API_TO_USE}_api target not found!") |
| 252 | endif() |
| 253 | endforeach() |
| 254 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 255 | add_executable(${TARGET_NAME} ${SRC_MAIN}) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 256 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 257 | target_link_libraries(${TARGET_NAME} PUBLIC ${UC_LIB_NAME}) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 258 | |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 259 | platform_custom_post_build(TARGET_NAME ${TARGET_NAME}) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 260 | |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 261 | endforeach() |
| 262 | |
Kshitij Sisodia | a1256e3 | 2022-02-23 14:40:45 +0000 | [diff] [blame] | 263 | print_useroptions() |