Refactor `IREE_ENABLE_EMITC` -> `IREE_OUTPUT_FORMAT_C`. (#9455)

Progress on https://github.com/google/iree/issues/8761
This supersedes https://github.com/google/iree/pull/8593

* `IREE_HAVE_EMITC_DIALECT` -> `IREE_HAVE_C_OUTPUT_FORMAT`
* inclusion style matches hal/drivers/
diff --git a/CMakeLists.txt b/CMakeLists.txt
index edeab9c..db5e928 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,12 +73,6 @@
 option(IREE_BUILD_EXPERIMENTAL_WEB_SAMPLES "Builds experimental web samples." OFF)
 
 #-------------------------------------------------------------------------------
-# Derived flags based on primary options
-#-------------------------------------------------------------------------------
-
-cmake_dependent_option(IREE_ENABLE_EMITC "Enables MLIR EmitC dependencies." ON ${IREE_BUILD_COMPILER} OFF)
-
-#-------------------------------------------------------------------------------
 # Runtime HAL Driver Options
 # By default, all runtime drivers supported by the current platform which do
 # not require external deps are enabled by default. This can be changed with:
@@ -204,6 +198,13 @@
 cmake_dependent_option(IREE_TARGET_BACKEND_WEBGPU "Enables the 'webgpu' compiler target backend" OFF ${IREE_BUILD_COMPILER} OFF)
 
 #-------------------------------------------------------------------------------
+# Compiler Output Formats
+#-------------------------------------------------------------------------------
+
+# The 'vm-bytecode' and 'vm-asm' formats are always enabled.
+cmake_dependent_option(IREE_OUTPUT_FORMAT_C "Enables the 'vm-c' output format, using MLIR EmitC" ON ${IREE_BUILD_COMPILER} OFF)
+
+#-------------------------------------------------------------------------------
 # IREE compilation toolchain configuration
 #-------------------------------------------------------------------------------
 
diff --git a/compiler/src/iree/compiler/API/BUILD b/compiler/src/iree/compiler/API/BUILD
index a052745..ff5353b 100644
--- a/compiler/src/iree/compiler/API/BUILD
+++ b/compiler/src/iree/compiler/API/BUILD
@@ -70,6 +70,7 @@
     deps = [
         "//compiler/src/iree/compiler/ConstEval",
         "//compiler/src/iree/compiler/Dialect/VM/IR",
+        "//compiler/src/iree/compiler/Dialect/VM/Target:init_targets",
         "//compiler/src/iree/compiler/Dialect/VM/Target/Bytecode",
         "//compiler/src/iree/compiler/InputConversion/MHLO",
         "//compiler/src/iree/compiler/InputConversion/TOSA",
diff --git a/compiler/src/iree/compiler/API/CMakeLists.txt b/compiler/src/iree/compiler/API/CMakeLists.txt
index 08d5b71..e609cac 100644
--- a/compiler/src/iree/compiler/API/CMakeLists.txt
+++ b/compiler/src/iree/compiler/API/CMakeLists.txt
@@ -48,7 +48,7 @@
     iree::compiler::InputConversion::MHLO::MHLO
     iree::compiler::InputConversion::TOSA::TOSA
     iree::compiler::Dialect::VM::IR::IR
-    iree::compiler::Dialect::VM::Target::Bytecode::Bytecode
+    iree::compiler::Dialect::VM::Target::init_targets
     iree::compiler::Pipelines
 
     # Passes and dialects.
diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD
index cce458c..3223009 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD
+++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD
@@ -14,7 +14,7 @@
 
 iree_cmake_extra_content(
     content = """
-if(NOT IREE_ENABLE_EMITC)
+if(NOT IREE_OUTPUT_FORMAT_C)
   return()
 endif()
 """,
diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt
index 4eeef37..44e29f4 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt
+++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt
@@ -8,7 +8,7 @@
 # To disable autogeneration for this file entirely, delete this header.        #
 ################################################################################
 
-if(NOT IREE_ENABLE_EMITC)
+if(NOT IREE_OUTPUT_FORMAT_C)
   return()
 endif()
 
diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/BUILD b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/BUILD
index 3be1ef5..5e6fec7 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/BUILD
+++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/BUILD
@@ -16,7 +16,7 @@
 
 iree_cmake_extra_content(
     content = """
-if(NOT IREE_ENABLE_EMITC)
+if(NOT IREE_OUTPUT_FORMAT_C)
   return()
 endif()
 """,
diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/CMakeLists.txt
index 1706fd3..d60949e 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/CMakeLists.txt
+++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/test/CMakeLists.txt
@@ -8,7 +8,7 @@
 # To disable autogeneration for this file entirely, delete this header.        #
 ################################################################################
 
-if(NOT IREE_ENABLE_EMITC)
+if(NOT IREE_OUTPUT_FORMAT_C)
   return()
 endif()
 
diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/BUILD b/compiler/src/iree/compiler/Dialect/VM/Target/BUILD
index 20b348f..f233deb 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Target/BUILD
+++ b/compiler/src/iree/compiler/Dialect/VM/Target/BUILD
@@ -15,9 +15,6 @@
 iree_compiler_cc_library(
     name = "init_targets",
     hdrs = ["init_targets.h"],
-    defines = [
-        "IREE_HAVE_EMITC_DIALECT",
-    ],
     deps = [
         "//compiler/src/iree/compiler/Dialect/VM/Target/Bytecode",
         "//compiler/src/iree/compiler/Dialect/VM/Target/C",
diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/C/BUILD b/compiler/src/iree/compiler/Dialect/VM/Target/C/BUILD
index 95e36d2..eee2c65 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Target/C/BUILD
+++ b/compiler/src/iree/compiler/Dialect/VM/Target/C/BUILD
@@ -4,7 +4,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-load("//build_tools/bazel:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_compiler_cc_library")
+load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -12,35 +12,6 @@
     licenses = ["notice"],  # Apache 2.0
 )
 
-iree_cmake_extra_content(
-    content = """
-if(NOT IREE_ENABLE_EMITC)
-  # If the real "C" library is enabled, it will define IREE_ENABLE_EMITC,
-  # which can be used for conditionally switching.
-  iree_cc_library(
-    NAME Enabled
-  )
-  iree_cc_library(
-    NAME C
-  )
-  iree_cc_library(
-    NAME TranslateToCpp
-  )
-  return()
-endif()
-""",
-)
-
-iree_compiler_cc_library(
-    name = "Enabled",
-    defines = [
-        "IREE_HAVE_EMITC_DIALECT",
-    ],
-    deps = [
-        "@llvm-project//mlir:EmitC",
-    ],
-)
-
 iree_compiler_cc_library(
     name = "TranslateToCpp",
     srcs = [
@@ -49,8 +20,10 @@
     hdrs = [
         "CppEmitter.h",
     ],
+    defines = [
+        "IREE_HAVE_C_OUTPUT_FORMAT",
+    ],
     deps = [
-        ":Enabled",
         "@llvm-project//llvm:Support",
         "@llvm-project//mlir:ControlFlowOps",
         "@llvm-project//mlir:EmitC",
@@ -73,7 +46,6 @@
         "TranslationFlags.h",
     ],
     deps = [
-        ":Enabled",
         ":TranslateToCpp",
         "//compiler/src/iree/compiler/Dialect/Util/IR",
         "//compiler/src/iree/compiler/Dialect/Util/Transforms",
diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/C/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VM/Target/C/CMakeLists.txt
index d4dbfd0..079ba44 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Target/C/CMakeLists.txt
+++ b/compiler/src/iree/compiler/Dialect/VM/Target/C/CMakeLists.txt
@@ -8,42 +8,16 @@
 # To disable autogeneration for this file entirely, delete this header.        #
 ################################################################################
 
-if(NOT IREE_ENABLE_EMITC)
-  # If the real "C" library is enabled, it will define IREE_ENABLE_EMITC,
-  # which can be used for conditionally switching.
-  iree_cc_library(
-    NAME Enabled
-  )
-  iree_cc_library(
-    NAME C
-  )
-  iree_cc_library(
-    NAME TranslateToCpp
-  )
-  return()
-endif()
-
 iree_add_all_subdirs()
 
 iree_cc_library(
   NAME
-    Enabled
-  DEPS
-    MLIREmitC
-  DEFINES
-    "IREE_HAVE_EMITC_DIALECT"
-  PUBLIC
-)
-
-iree_cc_library(
-  NAME
     TranslateToCpp
   HDRS
     "CppEmitter.h"
   SRCS
     "TranslateToCpp.cpp"
   DEPS
-    ::Enabled
     LLVMSupport
     MLIRControlFlow
     MLIREmitC
@@ -51,6 +25,8 @@
     MLIRIR
     MLIRSCF
     MLIRSupport
+  DEFINES
+    "IREE_HAVE_C_OUTPUT_FORMAT"
   PUBLIC
 )
 
@@ -65,7 +41,6 @@
     "TranslationFlags.cpp"
     "TranslationRegistration.cpp"
   DEPS
-    ::Enabled
     ::TranslateToCpp
     LLVMSupport
     MLIRIR
diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/VM/Target/CMakeLists.txt
index 2c3c2e8..ebbbfda 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Target/CMakeLists.txt
+++ b/compiler/src/iree/compiler/Dialect/VM/Target/CMakeLists.txt
@@ -4,12 +4,12 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-iree_add_all_subdirs()
-
-if(IREE_ENABLE_EMITC)
-  set(IREE_VM_CONDITIONAL_TARGETS
-    iree::compiler::Dialect::VM::Target::C
-  )
+set(_INIT_INTERNAL_DEPS)
+add_subdirectory(Bytecode)
+list(APPEND _INIT_INTERNAL_DEPS iree::compiler::Dialect::VM::Target::Bytecode)
+if(IREE_OUTPUT_FORMAT_C)
+  add_subdirectory(C)
+  list(APPEND _INIT_INTERNAL_DEPS iree::compiler::Dialect::VM::Target::C)
 endif()
 
 iree_cc_library(
@@ -18,7 +18,6 @@
   HDRS
     "init_targets.h"
   DEPS
-    iree::compiler::Dialect::VM::Target::Bytecode
-    ${IREE_VM_CONDITIONAL_TARGETS}
+    ${_INIT_INTERNAL_DEPS}
   PUBLIC
 )
diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/init_targets.h b/compiler/src/iree/compiler/Dialect/VM/Target/init_targets.h
index a05d491..795414d 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Target/init_targets.h
+++ b/compiler/src/iree/compiler/Dialect/VM/Target/init_targets.h
@@ -12,10 +12,11 @@
 
 namespace IREE {
 namespace VM {
+
 void registerToVMBytecodeTranslation();
-#ifdef IREE_HAVE_EMITC_DIALECT
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
 void registerToCTranslation();
-#endif  // IREE_HAVE_EMITC_DIALECT
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
 }  // namespace VM
 }  // namespace IREE
 
@@ -26,9 +27,10 @@
 inline void registerVMTargets() {
   static bool init_once = []() {
     IREE::VM::registerToVMBytecodeTranslation();
-#ifdef IREE_HAVE_EMITC_DIALECT
+
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
     IREE::VM::registerToCTranslation();
-#endif  // IREE_HAVE_EMITC_DIALECT
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
 
     return true;
   }();
diff --git a/compiler/src/iree/compiler/Tools/BUILD b/compiler/src/iree/compiler/Tools/BUILD
index 75f22ff..343faa1 100644
--- a/compiler/src/iree/compiler/Tools/BUILD
+++ b/compiler/src/iree/compiler/Tools/BUILD
@@ -59,7 +59,7 @@
         "init_mlir_passes.h",
     ],
     deps = [
-        "//compiler/src/iree/compiler/Dialect/VM/Target/C:Enabled",
+        "//compiler/src/iree/compiler/Dialect/VM/Target:init_targets",
         "@llvm-project//mlir:Affine",
         "@llvm-project//mlir:AffineTransforms",
         "@llvm-project//mlir:ArmNeon",
@@ -188,7 +188,6 @@
         "//compiler/src/iree/compiler/Codegen",
         "//compiler/src/iree/compiler/ConstEval",
         "//compiler/src/iree/compiler/Dialect/VM/Target:init_targets",
-        "//compiler/src/iree/compiler/Dialect/VM/Target/Bytecode",
         "//compiler/src/iree/compiler/Dialect/VM/Target/C",
         "//compiler/src/iree/compiler/Pipelines",
         "//compiler/src/iree/compiler/Utils",
diff --git a/compiler/src/iree/compiler/Tools/CMakeLists.txt b/compiler/src/iree/compiler/Tools/CMakeLists.txt
index a361c2c..0a27115 100644
--- a/compiler/src/iree/compiler/Tools/CMakeLists.txt
+++ b/compiler/src/iree/compiler/Tools/CMakeLists.txt
@@ -68,8 +68,8 @@
     iree::compiler::Dialect::Util::IR
     iree::compiler::Dialect::Util::Transforms
     iree::compiler::Dialect::VM::Analysis
-    iree::compiler::Dialect::VM::Conversion::VMToEmitC
     iree::compiler::Dialect::VM::IR
+    iree::compiler::Dialect::VM::Target::init_targets
     iree::compiler::Dialect::VM::Transforms
     iree::compiler::Dialect::Vulkan::IR
     iree::compiler::InputConversion::Common
@@ -88,9 +88,6 @@
     "init_mlir_dialects.h"
     "init_mlir_passes.h"
   DEPS
-    # Sets IREE_HAVE_EMITC_DIALECT and transitively depends on MLIREmitC
-    # if enabled.
-    iree::compiler::Dialect::VM::Target::C::Enabled
     MLIRAffine
     MLIRAffineTransforms
     MLIRArmNeon
@@ -120,6 +117,7 @@
     MLIRTosaTransforms
     MLIRTransforms
     MLIRVector
+    iree::compiler::Dialect::VM::Target::init_targets
   PUBLIC
 )
 
@@ -224,9 +222,7 @@
     MLIRTargetLLVMIRExport
     iree::compiler::Codegen::Codegen
     iree::compiler::ConstEval
-    iree::compiler::Dialect::VM::Target::Bytecode
     iree::compiler::Dialect::VM::Target::init_targets
-    iree::compiler::Dialect::VM::Target::C
     iree::compiler::Pipelines
     iree::compiler::Utils
   PUBLIC
diff --git a/compiler/src/iree/compiler/Tools/init_iree_passes.h b/compiler/src/iree/compiler/Tools/init_iree_passes.h
index 53e9f09..88c8211 100644
--- a/compiler/src/iree/compiler/Tools/init_iree_passes.h
+++ b/compiler/src/iree/compiler/Tools/init_iree_passes.h
@@ -29,12 +29,14 @@
 #include "iree/compiler/InputConversion/MHLO/Passes.h"
 #ifdef IREE_HAVE_TORCH_MLIR_DIALECTS
 #include "iree/compiler/InputConversion/TMTensor/Passes.h"
-#endif
+#endif  // IREE_HAVE_TORCH_MLIR_DIALECTS
 #include "iree/compiler/InputConversion/TOSA/Passes.h"
 #include "iree/compiler/Pipelines/Pipelines.h"
 
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
 // TODO: Remove these once rolled up into explicit registration.
 #include "iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.h"
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
 
 namespace mlir {
 namespace iree_compiler {
@@ -70,8 +72,11 @@
   // registration and that we need to force instantiation
   // of in order to register.
   // TODO: Eliminate these.
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
   IREE::VM::createConvertVMToEmitCPass();
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
 }
+
 }  // namespace iree_compiler
 }  // namespace mlir
 
diff --git a/compiler/src/iree/compiler/Tools/init_mlir_dialects.h b/compiler/src/iree/compiler/Tools/init_mlir_dialects.h
index 40b6aeb..10dbc4f 100644
--- a/compiler/src/iree/compiler/Tools/init_mlir_dialects.h
+++ b/compiler/src/iree/compiler/Tools/init_mlir_dialects.h
@@ -35,9 +35,9 @@
 #include "mlir/Dialect/Vector/IR/VectorOps.h"
 #include "mlir/IR/Dialect.h"
 
-#ifdef IREE_HAVE_EMITC_DIALECT
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
 #include "mlir/Dialect/EmitC/IR/EmitC.h"
-#endif  // IREE_HAVE_EMITC_DIALECT
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
 
 namespace mlir {
 
@@ -68,9 +68,9 @@
   // clang-format on
   tensor::registerInferTypeOpInterfaceExternalModels(registry);
 
-#ifdef IREE_HAVE_EMITC_DIALECT
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
   registry.insert<emitc::EmitCDialect>();
-#endif  // IREE_HAVE_EMITC_DIALECT
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
 }
 
 }  // namespace mlir
diff --git a/compiler/src/iree/compiler/Tools/iree_compile_lib.cc b/compiler/src/iree/compiler/Tools/iree_compile_lib.cc
index 736ec38..1013a5a 100644
--- a/compiler/src/iree/compiler/Tools/iree_compile_lib.cc
+++ b/compiler/src/iree/compiler/Tools/iree_compile_lib.cc
@@ -41,10 +41,10 @@
 #include "mlir/Support/ToolUtilities.h"
 #include "mlir/Tools/mlir-translate/Translation.h"
 
-#ifdef IREE_HAVE_EMITC_DIALECT
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
 #include "iree/compiler/Dialect/VM/Target/C/CModuleTarget.h"
 #include "iree/compiler/Dialect/VM/Target/C/TranslationFlags.h"
-#endif  // IREE_HAVE_EMITC_DIALECT
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
 
 namespace mlir {
 namespace iree_compiler {
@@ -137,9 +137,9 @@
       llvm::cl::values(
           clEnumValN(OutputFormat::vm_bytecode, "vm-bytecode",
                      "IREE VM Bytecode (default)"),
-#ifdef IREE_HAVE_EMITC_DIALECT
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
           clEnumValN(OutputFormat::vm_c, "vm-c", "C source module"),
-#endif
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
           clEnumValN(OutputFormat::vm_asm, "vm-asm", "IREE VM MLIR Assembly")),
       llvm::cl::init(OutputFormat::none), llvm::cl::cat(mainOptions));
 
@@ -172,7 +172,7 @@
       llvm::cl::init(false));
 
 // Optional output formats.
-#ifdef IREE_HAVE_EMITC_DIALECT
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
   auto cTargetOptions = IREE::VM::getCTargetOptionsFromFlags();
 #endif
 
@@ -283,11 +283,11 @@
       case OutputFormat::vm_bytecode:
         return translateModuleToBytecode(module.get(), bytecodeTargetOptions,
                                          os);
-#ifdef IREE_HAVE_EMITC_DIALECT
+#ifdef IREE_HAVE_C_OUTPUT_FORMAT
       case OutputFormat::vm_c:
         return mlir::iree_compiler::IREE::VM::translateModuleToC(
             module.get(), cTargetOptions, os);
-#endif
+#endif  // IREE_HAVE_C_OUTPUT_FORMAT
       case OutputFormat::hal_executable: {
         // Extract the serialized binary representation from the executable.
         auto executableOp =
diff --git a/docs/developers/get_started/cmake_options_and_variables.md b/docs/developers/get_started/cmake_options_and_variables.md
index d6dc955..4361a4b 100644
--- a/docs/developers/get_started/cmake_options_and_variables.md
+++ b/docs/developers/get_started/cmake_options_and_variables.md
@@ -26,10 +26,6 @@
 Enables instrumented compiler tracing. This requires that
 `IREE_ENABLE_RUNTIME_TRACING` also be set. Defaults to `OFF`.
 
-#### `IREE_ENABLE_EMITC`:BOOL
-
-Enables the build of the out-of-tree MLIR dialect EmitC. Defaults to `OFF`.
-
 #### `IREE_BUILD_COMPILER`:BOOL
 
 Builds the IREE compiler. Defaults to `ON`.
@@ -78,6 +74,10 @@
 
 Individual options enabling the build for each compiler target backend.
 
+#### `IREE_OUTPUT_FORMAT_C`:BOOL
+
+Enables the vm-c compiler output format, using MLIR EmitC. Defaults to `ON`.
+
 #### `IREE_DEV_MODE`:BOOL
 
 Configure settings to optimize for IREE development (as opposed to CI or
diff --git a/runtime/src/iree/vm/test/emitc/CMakeLists.txt b/runtime/src/iree/vm/test/emitc/CMakeLists.txt
index b103bbe..098c4c0 100644
--- a/runtime/src/iree/vm/test/emitc/CMakeLists.txt
+++ b/runtime/src/iree/vm/test/emitc/CMakeLists.txt
@@ -6,7 +6,7 @@
 
 iree_add_all_subdirs()
 
-if(IREE_ENABLE_EMITC)
+if(IREE_OUTPUT_FORMAT_C)
 
 iree_cc_test(
   NAME
diff --git a/samples/emitc_modules/CMakeLists.txt b/samples/emitc_modules/CMakeLists.txt
index da0aeef..85e7acc 100644
--- a/samples/emitc_modules/CMakeLists.txt
+++ b/samples/emitc_modules/CMakeLists.txt
@@ -4,7 +4,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-if(NOT IREE_ENABLE_EMITC)
+if(NOT IREE_OUTPUT_FORMAT_C)
   return()
 endif()
 
diff --git a/samples/static_library/CMakeLists.txt b/samples/static_library/CMakeLists.txt
index 25ce607..4b50e9b 100644
--- a/samples/static_library/CMakeLists.txt
+++ b/samples/static_library/CMakeLists.txt
@@ -94,7 +94,7 @@
 )
 
 
-if(NOT (IREE_ENABLE_EMITC OR DEFINED IREE_HOST_BINARY_ROOT))
+if(NOT (IREE_OUTPUT_FORMAT_C OR DEFINED IREE_HOST_BINARY_ROOT))
   return()
 endif()