summaryrefslogtreecommitdiff
path: root/scripts/cmake/platforms/simple_platform/build_configuration.cmake
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2023-03-10 16:33:23 +0000
committerKshitij Sisodia <kshitij.sisodia@arm.com>2023-03-15 13:51:01 +0000
commit26bc923b15be6d1a1788f5afb26241b6fb89a718 (patch)
tree77e30b6d3a2b93c99f26e34e1e369d9cfa2dfc1b /scripts/cmake/platforms/simple_platform/build_configuration.cmake
parent987efaeca438b7a3ef0926edef28a22a5801af9f (diff)
downloadml-embedded-evaluation-kit-26bc923b15be6d1a1788f5afb26241b6fb89a718.tar.gz
MLECO-3666: Updating to 23.02 dependencies.23.02-rc1
Updating dependency submodules to 23.02 versions. See https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ethos-u/+/refs/tags/23.02/23.02.json Change-Id: If0e396decadc1b4e3c6b263c65f75ccf0dafed28 Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'scripts/cmake/platforms/simple_platform/build_configuration.cmake')
-rw-r--r--scripts/cmake/platforms/simple_platform/build_configuration.cmake14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/cmake/platforms/simple_platform/build_configuration.cmake b/scripts/cmake/platforms/simple_platform/build_configuration.cmake
index 74b3896..3536c5b 100644
--- a/scripts/cmake/platforms/simple_platform/build_configuration.cmake
+++ b/scripts/cmake/platforms/simple_platform/build_configuration.cmake
@@ -1,5 +1,5 @@
#----------------------------------------------------------------------------
-# SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
+# SPDX-FileCopyrightText: Copyright 2022-2023 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");
@@ -21,6 +21,7 @@ function(set_platform_global_defaults)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_DIR}/bare-metal-gcc.cmake
CACHE FILEPATH "Toolchain file")
endif()
+
set(LINKER_SCRIPT_NAME "simple_platform" PARENT_SCOPE)
set(PLATFORM_DRIVERS_DIR "${HAL_PLATFORM_DIR}/simple" PARENT_SCOPE)
endfunction()
@@ -30,8 +31,15 @@ function(platform_custom_post_build)
cmake_parse_arguments(PARSED "" "${oneValueArgs}" "" ${ARGN} )
set_target_properties(${PARSED_TARGET_NAME} PROPERTIES SUFFIX ".axf")
- # Add link options for the linker script to be used:
+ # For GNU toolchain, we have different linker scripts for Debug and Release
+ # as the code footprint difference between the two is quite big.
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ string(TOLOWER ${CMAKE_BUILD_TYPE} LINKER_SCRIPT_SUFFIX)
+ set(LINKER_SCRIPT_NAME "${LINKER_SCRIPT_NAME}_${LINKER_SCRIPT_SUFFIX}" PARENT_SCOPE FORCE)
+ endif()
+
+ # Add link options for the linker script to be used:
add_linker_script(
${PARSED_TARGET_NAME} # Target
${CMAKE_SCRIPTS_DIR}/platforms/simple_platform # Directory path
@@ -56,4 +64,4 @@ function(platform_custom_post_build)
AXF_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PARSED_TARGET_NAME}.axf
SECTION_PATTERNS "${LINKER_SECTION_TAGS}"
OUTPUT_BIN_NAMES "${LINKER_OUTPUT_BIN_TAGS}")
-endfunction() \ No newline at end of file
+endfunction()