diff --git a/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt b/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt
index e42ced2737bb2e83d5cc4dd281ad475c7e88dce6..2feeaa2fefeb5b1a7dd937816e785a1dd641a5e4 100644
--- a/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt
+++ b/hpvm/projects/hpvm-tensor-rt/CMakeLists.txt
@@ -134,6 +134,7 @@ if(LLVM_BUILD_DIR)  # Defined in ../CMakeLists.txt. This means we're compiling i
   # It's important that tensor_runtime.ll goes here if we're compiling with LLVM
   # Some HPVM passes look for tensor_runtime.ll in this folder (which is usually build/lib)
   set(TENSOR_RT_LL_PREFIX ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+  add_dependencies(tensor_runtime clang)
 else()
   # Surely if we're compiling outside of hpvm, then we need the system-wide clang.
   # Use it but check version 9 first