Build: Add option to enable or disable Audit Log

Adds a build option that makes it possible to enable or disable the
TF-M Audit Log partition. The option TFM_PARTITION_AUDIT_LOG can be
provided in the CMake configure command, and is enabled by default if
not supplied.

Change-Id: Ib60f22aeb62652e34a1ac43a61154288e6d989b3
Signed-off-by: Jamie Fox <jamie.fox@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 668906b..6bb1f4f 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -115,6 +115,8 @@
 set (TFM_LEGACY_API ON)
 set (CORE_TEST_IPC OFF)
 
+option(TFM_PARTITION_AUDIT_LOG "Enable the TF-M Audit Log partition" ON)
+
 if(${TARGET_PLATFORM} STREQUAL "AN521" OR ${TARGET_PLATFORM} STREQUAL "AN519")
 	set (REFERENCE_PLATFORM ON)
 endif()
@@ -183,10 +185,6 @@
 	set(TFM_PARTITION_TEST_SECURE_SERVICES ON)
 endif()
 
-if (TFM_PARTITION_TEST_SECURE_SERVICES)
-	add_definitions(-DTFM_PARTITION_TEST_SECURE_SERVICES)
-endif()
-
 if (SERVICE_TEST_NS)
 	add_definitions(-DSERVICES_TEST_NS)
 	set(TEST_FRAMEWORK_NS ON)
@@ -200,10 +198,22 @@
 	add_definitions(-DTEST_FRAMEWORK_NS)
 endif()
 
+if (CORE_IPC)
+	set(TFM_PARTITION_AUDIT_LOG OFF)
+endif()
+
+if (TFM_PARTITION_AUDIT_LOG)
+	add_definitions(-DTFM_PARTITION_AUDIT_LOG)
+endif()
+
 if (TFM_PARTITION_TEST_CORE)
 	add_definitions(-DTFM_PARTITION_TEST_CORE)
 endif()
 
+if (TFM_PARTITION_TEST_SECURE_SERVICES)
+	add_definitions(-DTFM_PARTITION_TEST_SECURE_SERVICES)
+endif()
+
 if (PSA_API_TEST)
 	add_definitions(-DPSA_API_TEST_NS)
 	set(PSA_API_TEST_NS ON)
@@ -294,4 +304,4 @@
 set(MBEDTLS_C_FLAGS_BL2 "-D__ARM_FEATURE_CMSE=3 -D__thumb2__ ${COMMON_COMPILE_FLAGS_STR} -DMBEDTLS_CONFIG_FILE=\\\\\\\"config-boot.h\\\\\\\" -I${CMAKE_CURRENT_LIST_DIR}/bl2/ext/mcuboot/include")
 if (MCUBOOT_SIGNATURE_TYPE STREQUAL "RSA-3072")
 	string(APPEND MBEDTLS_C_FLAGS_BL2 " -DMCUBOOT_SIGN_RSA_LEN=3072")
-endif()
\ No newline at end of file
+endif()