Do not print memory stats for wmmu simulations

We do not print memory statistics for WMMU simulations due to b/258304148.

Also add some flags to further shrink the library/binary.

Change-Id: I2c1e744e22f49cefec0d63d631b331006b1347c7
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 348728d..8963037 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,10 +49,19 @@
 # IREE-specific definitions
 #-------------------------------------------------------------------------------
 set(SPRINGBOK_CONFIG_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/springbok_config.h")
-add_definitions(-DFLATCC_USE_GENERIC_ALIGNED_ALLOC)
-add_definitions(-DIREE_SYNCHRONIZATION_DISABLE_UNSAFE=1)
-add_definitions(-DIREE_FILE_IO_ENABLE=0)
-add_definitions(-DIREE_USER_CONFIG_H="${SPRINGBOK_CONFIG_HEADER}")
+add_compile_definitions(FLATCC_USE_GENERIC_ALIGNED_ALLOC)
+add_compile_definitions(IREE_SYNCHRONIZATION_DISABLE_UNSAFE=1)
+add_compile_definitions(IREE_FILE_IO_ENABLE=0)
+add_compile_definitions(IREE_USER_CONFIG_H="${SPRINGBOK_CONFIG_HEADER}")
+if (NOT BUILD_NO_WMMU)
+  add_compile_definitions(IREE_HAL_COMMAND_BUFFER_VALIDATION_ENABLE=0)
+  add_compile_definitions(IREE_HAL_MODULE_STRING_UTIL_ENABLE=0)
+  add_compile_definitions(IREE_STATISTICS_ENABLE=0)
+  add_compile_definitions(IREE_STATUS_MODE=0)
+  add_compile_definitions(IREE_VM_BACKTRACE_ENABLE=0)
+  add_compile_definitions(IREE_VM_EXT_F64_ENABLE=0)
+  add_compile_definitions(IREE_VM_EXT_I64_ENABLE=0)
+endif()
 
 # The project does a cmake hack here -- at the executable linkage stage, we
 # append the logging library (and springbok BSP). Any logging library update