Build: Improve multi-core build in CommonConfig.cmake

Improve and fix the multi-core build configurations in
CommonConfig.cmake

Change-Id: I1e8abe81edaa6e76901f27ab02f2e8cbb15cc9a6
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 0e98af9..ae6ff2c 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -67,6 +67,10 @@
 # building status in multi-core scenario.
 # The updated configuration will be used in following compiler setting.
 if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
+	if (NOT CORE_IPC)
+		message(FATAL_ERROR "CORE_IPC is OFF. Multi-core topology should work in IPC model.")
+	endif()
+
 	include("Common/MultiCore")
 
 	if (NOT DEFINED TFM_BUILD_IN_SPE)
@@ -74,9 +78,7 @@
 	else()
 		select_arm_cpu_type(${TFM_BUILD_IN_SPE})
 	endif()
-endif()
 
-if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
 	# CMSE is unnecessary in multi-core scenarios.
 	# TODO: Need further discussion about if CMSE is required when an Armv8-M
 	# core acts as secure core in multi-core scenario.
@@ -180,6 +182,10 @@
 	add_definitions(-DTFM_PSA_API)
 endif()
 
+if (DEFINED TFM_MULTI_CORE_TOPOLOGY AND TFM_MULTI_CORE_TOPOLOGY)
+	add_definitions(-DTFM_MULTI_CORE_TOPOLOGY)
+endif()
+
 if (TFM_LEGACY_API)
 	add_definitions(-DTFM_LEGACY_API)
 endif()