aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2021-05-26 12:02:30 +0200
committerKristofer Jonsson <kristofer.jonsson@arm.com>2021-05-26 12:59:43 +0200
commit1c62899409b6a813210173b1a5958818c1f27899 (patch)
treef1916085caccf09e19fb8db31c121a605994a4ec
parent0cb936d6affb4cbc58c1766932d579eb5906d3a3 (diff)
downloadethos-u-core-platform-1c62899409b6a813210173b1a5958818c1f27899.tar.gz
Optimizations
Setting NDEBUG for non debug builds. This will disabled the asserts used by the for example the Ethos-U driver. Disabling caches by default. Change-Id: I614edc09b99e9997af7e113c7565d64f273f3fa0
-rw-r--r--cmake/toolchain/arm-none-eabi-gcc.cmake6
-rw-r--r--cmake/toolchain/armclang.cmake6
-rw-r--r--targets/corstone-300/CMakeLists.txt2
3 files changed, 11 insertions, 3 deletions
diff --git a/cmake/toolchain/arm-none-eabi-gcc.cmake b/cmake/toolchain/arm-none-eabi-gcc.cmake
index ea95eef..2c0ebd0 100644
--- a/cmake/toolchain/arm-none-eabi-gcc.cmake
+++ b/cmake/toolchain/arm-none-eabi-gcc.cmake
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2020 Arm Limited. All rights reserved.
+# Copyright (c) 2020-2021 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -47,6 +47,10 @@ add_compile_options(
-mthumb
"$<$<COMPILE_LANGUAGE:CXX>:-fno-unwind-tables;-fno-rtti;-fno-exceptions>")
+# Compile defines
+add_compile_definitions(
+ "$<$<NOT:$<CONFIG:DEBUG>>:NDEBUG>")
+
# Link options
add_link_options(
-mcpu=${TARGET_CPU}
diff --git a/cmake/toolchain/armclang.cmake b/cmake/toolchain/armclang.cmake
index 72eb456..bb29286 100644
--- a/cmake/toolchain/armclang.cmake
+++ b/cmake/toolchain/armclang.cmake
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2020 Arm Limited. All rights reserved.
+# Copyright (c) 2020-2021 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -58,6 +58,10 @@ add_compile_options(
"$<$<CONFIG:DEBUG>:-gdwarf-3>"
"$<$<COMPILE_LANGUAGE:CXX>:-fno-unwind-tables;-fno-rtti;-fno-exceptions>")
+# Compile defines
+add_compile_definitions(
+ "$<$<NOT:$<CONFIG:DEBUG>>:NDEBUG>")
+
# Link options
add_link_options(
--cpu=${__LINK_TARGET}
diff --git a/targets/corstone-300/CMakeLists.txt b/targets/corstone-300/CMakeLists.txt
index 4e766df..85fe944 100644
--- a/targets/corstone-300/CMakeLists.txt
+++ b/targets/corstone-300/CMakeLists.txt
@@ -28,7 +28,7 @@ endif()
set(ETHOSU_COMMAND_DEFAULT python3 ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/run_ctest.py -t corstone-300)
-option(CPU_CACHE_ENABLE "Enable CPU instruction- and data cache" ON)
+option(CPU_CACHE_ENABLE "Enable CPU instruction- and data cache" OFF)
#############################################################################
# Project