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
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 @@
     -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}