Index: llvm/cmake/modules/AddLLVM.cmake =================================================================== --- llvm/cmake/modules/AddLLVM.cmake +++ llvm/cmake/modules/AddLLVM.cmake @@ -2156,6 +2156,7 @@ RESULT_VARIABLE touch_head_result ERROR_QUIET) if (NOT touch_head_result EQUAL 0) + set(${out_var} "" PARENT_SCOPE) return() endif() endif() Index: llvm/include/llvm/Support/CMakeLists.txt =================================================================== --- llvm/include/llvm/Support/CMakeLists.txt +++ llvm/include/llvm/Support/CMakeLists.txt @@ -11,7 +11,7 @@ # A fake version file and is not expected to exist. It is being used to # force regeneration of VCSRevision.h for source directory with no write # permission available. - if (NOT llvm_vc) + if (llvm_vc STREQUAL "") set(fake_version_inc "${CMAKE_CURRENT_BINARY_DIR}/__FakeVCSRevision.h") endif() endif()