[PATCH] D58204: CMake: Fix stand-alone clang builds since r353268

Tom Stellard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 13 13:11:29 PST 2019


tstellar created this revision.
tstellar added reviewers: phosek, andrewrk, smeenai.
Herald added subscribers: cfe-commits, mgorny.
Herald added projects: clang, LLVM.

Handle the case where LLVM_MAIN_SRC_DIR is not set and also use
LLVM_CMAKE_DIR for locating installed cmake files rather than
LLVM_CMAKE_PATH.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D58204

Files:
  clang/lib/Basic/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1718,6 +1718,9 @@
 endfunction()
 
 function(find_first_existing_vc_file path out_var)
+  if(NOT EXISTS "${path}")
+    return()
+  endif()
   if(EXISTS "${path}/.svn")
     set(svn_files
       "${path}/.svn/wc.db"   # SVN 1.7
Index: clang/lib/Basic/CMakeLists.txt
===================================================================
--- clang/lib/Basic/CMakeLists.txt
+++ clang/lib/Basic/CMakeLists.txt
@@ -10,7 +10,7 @@
 # The VC revision include that we want to generate.
 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
 
-set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
+set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
 
 if(llvm_vc)
   set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58204.186726.patch
Type: text/x-patch
Size: 953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190213/2ae42682/attachment.bin>


More information about the cfe-commits mailing list