MLECO-2983: Preliminary support to allow semihosting

Adding basic support to allow applications to build with semihosting
support. Default state is always disabled.

Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Change-Id: I1d34c3a246560aaffcb34eee801e1a87d887d559
diff --git a/scripts/cmake/toolchains/bare-metal-armclang.cmake b/scripts/cmake/toolchains/bare-metal-armclang.cmake
index 065395b..9752053 100644
--- a/scripts/cmake/toolchains/bare-metal-armclang.cmake
+++ b/scripts/cmake/toolchains/bare-metal-armclang.cmake
@@ -96,6 +96,12 @@
     --xref
     "$<$<CONFIG:RELEASE>:--no_debug>")
 
+function(configure_semihosting TARGET_NAME SEMIHOSTING)
+    if (${SEMIHOSTING})
+        target_compile_definitions(${TARGET_NAME} PUBLIC USE_SEMIHOSTING)
+    endif()
+endfunction()
+
 # Function to add a map file output for the linker to dump diagnostic information to.
 function(add_target_map_file TARGET_NAME MAP_FILE_PATH)
     target_link_options(${TARGET_NAME} PUBLIC