diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 5e13b1751bbd..45f6746948d2 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -696,6 +696,9 @@ macro(add_llvm_external_project name) endif() if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR) set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}") + else() + set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR + CACHE PATH "Path to ${name} source directory") endif() if (EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}/CMakeLists.txt) option(LLVM_EXTERNAL_${nameUPPER}_BUILD