Build: Also strip workspace from __FILE__

Add another -fmacro-prefix-map argument to the GCC/Clang command line
which strips the name of the workspace from the __FILE__ macro. This
applies primarily to files which live outside of TF-M and will ensure
that the following transformations now occur:

/workspace/tf-m-tests/directory/file.c -> tf-m-tests/directory/file.c
/workspace/trusted-firmware-m/directory/file.c -> directory/file.c

This ensures that we remove user specific elements of the build which
also keeping assertions traceable (as we can easily see source files
that are located outside of trusted-firmware-m).

Change-Id: I26cd1e0049120ba108524ddedaed6b6b69f60dcf
Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com>
diff --git a/toolchain_CLANG.cmake b/toolchain_CLANG.cmake
index 5526917..c75e8f0 100644
--- a/toolchain_CLANG.cmake
+++ b/toolchain_CLANG.cmake
@@ -71,6 +71,8 @@
 set(BL2_COMPILER_CP_FLAG -mfloat-abi=soft)
 set(BL2_LINKER_CP_OPTION -mfloat-abi=soft -lcrt0 -ldummyhost)
 
+file(REAL_PATH "${CMAKE_SOURCE_DIR}/../" TOP_LEVEL_PROJECT_DIR)
+
 add_compile_options(
      -Wno-ignored-optimization-argument
      -Wno-unused-command-line-argument
@@ -83,6 +85,9 @@
      -fshort-enums
      -fshort-wchar
      -funsigned-char
+     # Strip /workspace/
+     -fmacro-prefix-map=${TOP_LEVEL_PROJECT_DIR}/=
+     # Strip /workspace/trusted-firmware-m
      -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=
      -std=c99
 )