From 8b89ca7c81f701fb6b596f1ed644959f10167d38 Mon Sep 17 00:00:00 2001 From: Trevor Morris Date: Tue, 9 Mar 2021 16:29:09 -0800 Subject: [PATCH] Fix TVM compile without LLVM (#7621) * Fix TVM compile without LLVM * Fix formatting --- src/target/metadata_module.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/target/metadata_module.cc b/src/target/metadata_module.cc index e2575c34d8f2..0b30d42c876c 100644 --- a/src/target/metadata_module.cc +++ b/src/target/metadata_module.cc @@ -116,8 +116,12 @@ runtime::Module CreateMetadataModule( crt_exportable_modules.push_back(target_module); target_module = CreateCSourceCrtMetadataModule(crt_exportable_modules, target); } else if (target->kind->name == "llvm") { +#ifdef TVM_LLVM_VERSION crt_exportable_modules.push_back(target_module); target_module = CreateLLVMCrtMetadataModule(crt_exportable_modules, target); +#else // TVM_LLVM_VERSION + LOG(FATAL) << "TVM was not built with LLVM enabled."; +#endif // TVM_LLVM_VERSION } } else { if (!non_crt_exportable_modules.empty()) {