From 15460e38878dd1f68e53c55477b7aedb0a616daf Mon Sep 17 00:00:00 2001 From: Jacob Hegna Date: Wed, 23 Jun 2021 05:22:18 +0000 Subject: [PATCH] Fail gracefully if no inlining model is available to download. Differential Revision: https://reviews.llvm.org/D104829 --- cmake/modules/TensorFlowCompile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/modules/TensorFlowCompile.cmake b/cmake/modules/TensorFlowCompile.cmake index 27b9d33a33f..6f77174982f 100644 --- a/cmake/modules/TensorFlowCompile.cmake +++ b/cmake/modules/TensorFlowCompile.cmake @@ -88,6 +88,11 @@ endfunction() function(tf_find_and_compile model default_url default_path generation_config tag_set signature_def_key fname cpp_class) if ("${model}" STREQUAL "download") + # Crash if the user wants to download a model but a URL is set to "TO_BE_UPDATED" + if ("${LLVM_INLINER_MODEL_CURRENT_URL}" STREQUAL "TO_BE_UPDATED") + message(FATAL_ERROR "LLVM_INLINER_MODEL_PATH was set to 'download' but there is no model url currently specified in cmake - likely, the model interface recently changed, and so there is not a released model available.") + endif() + set(model ${default_url}) endif()