diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2024-04-12 11:30:02 +0100 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2024-05-07 09:41:06 +0100 |
commit | 774c7caaaccacfa07b2ba144f1602e640a5edd86 (patch) | |
tree | d247ef17b453ad055a7f4bc4de794c132e8cb9a1 /CMakeLists.txt | |
parent | 4cef9acc2624a31111b47c25b8b1a2f37f7e0cb9 (diff) | |
download | ml-embedded-evaluation-kit-774c7caaaccacfa07b2ba144f1602e640a5edd86.tar.gz |
MLECO-4935: Refactoring user options
Refactoring for CMake configuration options to allow target platform
to drive their own defaults for certain dependent options.
For example, the MPS3 target platform defaults to SSE-300 sub-system
while native target doesn't need to worry about sub-system and CMSIS
options which it will never use. This allows MPS4 target to default
to SSE-315 and set the NPU arch to Arm Ethos-U65 as it should, which
otherwise would have had to be explictly specified by the user.
A welcome by-product of this is also that the options summary at the
end of a successful CMake configuration stage would only include the
settings that are actually used by the given target.
Change-Id: Ibb7f8233d427cd33f39eeb4c71d88193aa998ebd
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Tested-by: mlecosys <mlecosys@arm.com>
Reviewed-by: Alex Tawse <alex.tawse@arm.com>
Reviewed-by: Conor Kennedy <conor.kennedy@arm.com>
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c458eb9..65119fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ #---------------------------------------------------------------------------- -# SPDX-FileCopyrightText: Copyright 2021-2024 Arm Limited and/or its affiliates <open-source-office@arm.com> +# SPDX-FileCopyrightText: Copyright 2021-2024 Arm Limited and/or its +# affiliates <open-source-office@arm.com> # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,8 +38,7 @@ set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF) set(SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scripts) -set(CMAKE_SCRIPTS_DIR ${SCRIPTS_DIR}/cmake) -set(CMAKE_TOOLCHAIN_DIR ${CMAKE_SCRIPTS_DIR}/toolchains) +set(CMAKE_TOOLCHAIN_DIR ${SCRIPTS_DIR}/cmake/toolchains) set(DOWNLOAD_DEP_DIR ${CMAKE_BINARY_DIR}/dependencies) set(DEPENDENCY_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dependencies) set(CORE_PLATFORM_DIR ${DEPENDENCY_ROOT_DIR}/core-platform) @@ -46,8 +46,12 @@ set(CORE_PLATFORM_DIR ${DEPENDENCY_ROOT_DIR}/core-platform) set(RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources_downloaded CACHE PATH "Resources directory") set(HAL_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source/hal/source/platform) +list(APPEND CMAKE_MODULE_PATH + "${SCRIPTS_DIR}/cmake" + "${SCRIPTS_DIR}/cmake/configuration_options" + "${SCRIPTS_DIR}/cmake/timing_adapter") -include(${CMAKE_SCRIPTS_DIR}/source_gen_utils.cmake) +include(source_gen_utils) enable_testing() @@ -58,7 +62,8 @@ else() message(STATUS "Binary directory: ${CMAKE_BINARY_DIR}") endif() -include(${CMAKE_SCRIPTS_DIR}/common_user_options.cmake) +# Include common configuration options +include(common_opts) # Check if the resources_downloaded needs update check_update_public_resources(${RESOURCES_DIR}) @@ -73,8 +78,6 @@ message(STATUS "Using CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}") assert_defined(LOG_LEVEL) assert_defined(TENSORFLOW_SRC_PATH) assert_defined(TARGET_PLATFORM) -assert_defined(TARGET_SUBSYSTEM) -assert_defined(ETHOS_U_NPU_ENABLED) assert_defined(USE_CASE_BUILD) assert_defined(CPU_PROFILE_ENABLED) assert_defined(CMAKE_TOOLCHAIN_FILE) @@ -114,7 +117,7 @@ endif () add_subdirectory(${PROFILER_DIR} ${CMAKE_BINARY_DIR}/profiler) # Include the tensorflow build target -include(${CMAKE_SCRIPTS_DIR}/tensorflow.cmake) +include(tensorflow_lite_micro) # Add the common API library target (tensorflow-lite-micro target is needed) add_subdirectory(${SRC_PATH}/application/api/common ${CMAKE_BINARY_DIR}/api/common) |