Improve CMake checks when building EmitC and bump submodule

Closes https://github.com/google/iree/pull/2246

PiperOrigin-RevId: 317199369
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6dca0f6..501cd0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,14 +59,21 @@
   set(IREE_ENABLE_MLIR ON CACHE BOOL "Enable LLVM dependencies if the IREE compiler is build." FORCE)
 endif()
 
-if(${IREE_ENABLE_EMITC} AND NOT ${IREE_ENABLE_MLIR})
-  message(FATAL_ERROR "Enabling EmitC requires setting IREE_ENABLE_MLIR to ON.")
-endif()
-
 if (${IREE_ENABLE_MLIR})
   set(IREE_MLIR_DEP_MODE "BUNDLED" CACHE STRING "One of BUNDLED (default), DISABLED, INSTALLED")
 endif()
 
+if(${IREE_ENABLE_EMITC})
+  if(NOT ${IREE_ENABLE_MLIR})
+    message(FATAL_ERROR "Enabling EmitC requires setting IREE_ENABLE_MLIR to ON.")
+  endif()
+
+  string(TOUPPER "${IREE_MLIR_DEP_MODE}" uppercase_IREE_MLIR_DEP_MODE)
+  if(NOT uppercase_IREE_MLIR_DEP_MODE MATCHES "^(BUNDLED|INSTALLED)$")
+    message(FATAL_ERROR "Enabling EmitC requires IREE_MLIR_DEP_MODE set to BUNDELED or INSTALLED.")
+  endif()
+endif()
+
 #-------------------------------------------------------------------------------
 # Target and backend configuration
 #-------------------------------------------------------------------------------
diff --git a/SUBMODULE_VERSIONS b/SUBMODULE_VERSIONS
index 411ecd5..4e78a42 100644
--- a/SUBMODULE_VERSIONS
+++ b/SUBMODULE_VERSIONS
@@ -5,7 +5,7 @@
 f2fb48c3b3d79a75a88a99fba6576b25d42ec528 third_party/googletest
 92d8ad02e92fed3884169ba5d98056fe4fa5660d third_party/llvm-project
 17b12a4481daa150e2d1ea3ada086b551b856707 third_party/marl
-ce77ac17e8a84cbbcf7dd567b1dc796b3fe1579c third_party/mlir-emitc
+67f3ccebee84f3488b46a8d3ac005178c52ff264 third_party/mlir-emitc
 80d452484c5409444b0ec19383faa84bb7a4d351 third_party/pybind11
 9f53ba413e6fc879236dcaa3e008915973d67a4f third_party/ruy
 b73f111094da3e380a1774b56b15f16c90ae8e23 third_party/sdl2
diff --git a/third_party/mlir-emitc b/third_party/mlir-emitc
index ce77ac1..67f3cce 160000
--- a/third_party/mlir-emitc
+++ b/third_party/mlir-emitc
@@ -1 +1 @@
-Subproject commit ce77ac17e8a84cbbcf7dd567b1dc796b3fe1579c
+Subproject commit 67f3ccebee84f3488b46a8d3ac005178c52ff264