Adding more (still incomplete) CMake files and fixing public build errors.
With this base/, hal/ and vm/ compile and link.

PiperOrigin-RevId: 270336801
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12d8775..b03f95a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,8 @@
 # limitations under the License.
 
 cmake_minimum_required(VERSION 3.5)
+cmake_policy(SET CMP0077 NEW)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 
 #-------------------------------------------------------------------------------
 # Project configuration
@@ -22,6 +24,12 @@
 set(IREE_IDE_FOLDER IREE)
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
+option(IREE_ENABLE_DEBUG "Enables debugging of the VM." ON)
+option(IREE_ENABLE_TRACING "Enables WTF tracing." OFF)
+
+option(IREE_BUILD_TESTS "Builds IREE unit tests." ON)
+option(IREE_BUILD_DEBUGGER "Builds the IREE debugger app." OFF)
+
 #-------------------------------------------------------------------------------
 # IREE-specific CMake configuration
 #-------------------------------------------------------------------------------
@@ -29,22 +37,36 @@
 list(APPEND CMAKE_MODULE_PATH
   ${CMAKE_CURRENT_LIST_DIR}/build_tools/cmake/
   ${CMAKE_CURRENT_LIST_DIR}/third_party/abseil-cpp/absl/copts/
+  ${CMAKE_CURRENT_LIST_DIR}/third_party/flatbuffers/CMake/
 )
+
+include(iree_macros)
 include(iree_copts)
 include(iree_cc_library)
 include(iree_cc_test)
 
-option(IREE_BUILD_TESTS "Builds IREE unit tests." ON)
-
 #-------------------------------------------------------------------------------
 # Third-party dependencies
 #-------------------------------------------------------------------------------
 
-add_subdirectory(third_party/abseil-cpp)
+include(external_cc_library)
+include(flatbuffer_cc_library)
+
+add_subdirectory(build_tools/third_party/ruy EXCLUDE_FROM_ALL)
+add_subdirectory(build_tools/third_party/vulkan_memory_allocator EXCLUDE_FROM_ALL)
+
+add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL)
+add_subdirectory(third_party/flatbuffers EXCLUDE_FROM_ALL)
 add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
+add_subdirectory(third_party/vulkan_headers EXCLUDE_FROM_ALL)
 
 #-------------------------------------------------------------------------------
 # IREE top-level libraries
 #-------------------------------------------------------------------------------
 
 add_subdirectory(iree/base)
+add_subdirectory(iree/hal)
+add_subdirectory(iree/samples)
+add_subdirectory(iree/schemas)
+add_subdirectory(iree/tools)
+add_subdirectory(iree/vm)