Build: Update IAR cmake files, fix Windows build errors

Fixed regex issue in toolchain_IARARM.cmake, causing Windows build errors

Moved --map option from toolchain file to CMakeLists.txt files, like
for ARMClang and GNUARM

Removed dead code from toolchain_IARARM.cmake

Renamed IAR RTX libraries in CMakeLists.txt

Signed-off-by: TTornblom <thomas.tornblom@iar.com>
Change-Id: I01805f59a5be0ca4cd2bf47f20dd4a8852c1ea54
diff --git a/bl2/CMakeLists.txt b/bl2/CMakeLists.txt
index b49677e..6199eda 100644
--- a/bl2/CMakeLists.txt
+++ b/bl2/CMakeLists.txt
@@ -38,6 +38,7 @@
     PRIVATE
         $<$<C_COMPILER_ID:GNU>:-Wl,-Map=${CMAKE_BINARY_DIR}/bin/bl2.map>
         $<$<C_COMPILER_ID:ARMClang>:--map>
+        $<$<C_COMPILER_ID:IAR>:--map\;${CMAKE_BINARY_DIR}/bin/bl2.map>
 )
 
 add_convert_to_bin_target(bl2)
diff --git a/lib/ext/CMSIS_5/CMakeLists.txt b/lib/ext/CMSIS_5/CMakeLists.txt
index 6c5167d..818b09d 100644
--- a/lib/ext/CMSIS_5/CMakeLists.txt
+++ b/lib/ext/CMSIS_5/CMakeLists.txt
@@ -18,9 +18,9 @@
     set_target_properties(CMSIS_5_RTX_V8MBN PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/ARM/RTX_V8MBN.lib)
     set_target_properties(CMSIS_5_RTX_CM3   PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/ARM/RTX_CM3.lib)
 elseif("${CMAKE_C_COMPILER_ID}" STREQUAL IAR)
-    set_target_properties(CMSIS_5_RTX_V8MMN PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/libRTX_V8MMN.a)
-    set_target_properties(CMSIS_5_RTX_V8MBN PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/libRTX_V8MBN.a)
-    set_target_properties(CMSIS_5_RTX_CM3   PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/libRTX_CM3.a)
+    set_target_properties(CMSIS_5_RTX_V8MMN PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MMN.a)
+    set_target_properties(CMSIS_5_RTX_V8MBN PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_V8MBN.a)
+    set_target_properties(CMSIS_5_RTX_CM3   PROPERTIES IMPORTED_LOCATION ${CMSIS_5_PATH}/RTOS2/RTX/Library/IAR/RTX_CM3.a)
 else()
     message(FATAL_ERROR "${CMAKE_C_COMPILER_ID} does not have CMSIS RTX static libraries set up")
 endif()
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index e109e3d..9c19faf 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -58,6 +58,7 @@
         --entry=Reset_Handler
         $<$<C_COMPILER_ID:GNU>:-Wl,-Map=${CMAKE_BINARY_DIR}/bin/tfm_s.map>
         $<$<C_COMPILER_ID:ARMClang>:--map>
+        $<$<C_COMPILER_ID:IAR>:--map\;${CMAKE_BINARY_DIR}/bin/tfm_s.map>
 )
 
 add_convert_to_bin_target(tfm_s)
diff --git a/toolchain_IARARM.cmake b/toolchain_IARARM.cmake
index 1d58f0f..b08a28e 100644
--- a/toolchain_IARARM.cmake
+++ b/toolchain_IARARM.cmake
@@ -103,7 +103,6 @@
     target_link_options(${target}
         PRIVATE
         --config $<TARGET_OBJECTS:${target}_scatter>
-        --map $<TARGET_FILE:${target}>.map
     )
     add_dependencies(${target}
         ${target}_scatter
@@ -119,17 +118,13 @@
         # set_source_file_properties command, so instead we just parse the regex
         # for the filename and set the property on all files, regardless of if
         # the generator expression would evaluate to true or not.
-        string(REGEX REPLACE ".*:(.*)>$" "\\1" SCATTER_FILE_PATH ${scatter_file})
+        string(REGEX REPLACE ".*>:(.*)>$" "\\1" SCATTER_FILE_PATH "${scatter_file}")
         set_source_files_properties(${SCATTER_FILE_PATH}
             PROPERTIES
             LANGUAGE C
         )
     endforeach()
 
-    set_target_properties(${target}_scatter PROPERTIES
-        SUFFIX ".icf"
-    )
-
     target_link_libraries(${target}_scatter
         platform_region_defs
         psa_interface