IVGCVSW-6815 Script Analysis of dependencies

 * Add map file generation to ArmNN for debug mode

Signed-off-by: Keith Davis <keith.davis@arm.com>
Change-Id: I10ae17cd0e1d83a903eaebd95e2b06d0aa771f96
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b460b16..1e99616 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -442,6 +442,13 @@
 
 target_compile_definitions(armnn PRIVATE "ARMNN_COMPILING_DLL")
 
+# Generate a map file for debug mode only
+if(CMAKE_BUILD_TYPE MATCHES debug)
+    set_property(TARGET armnn APPEND_STRING PROPERTY
+        LINK_FLAGS " -Wl,-Map=libarmnnMapFile.map")
+    message(STATUS "Linker will generate mapfile " )
+endif()
+
 target_include_directories(armnn
     PUBLIC
         $<INSTALL_INTERFACE:include>