]> granicus.if.org Git - llvm/commitdiff
[CMake] Honor LLVM_EXTERNAL_<proj>_SOURCE_DIR
authorDavid Greene <greened@obbligato.org>
Fri, 22 Feb 2019 21:19:48 +0000 (21:19 +0000)
committerDavid Greene <greened@obbligato.org>
Fri, 22 Feb 2019 21:19:48 +0000 (21:19 +0000)
When LLVM_ENABLE_PROJECTS is set, CMake assumes the project
directories are all side-by-side. This is not always the case and
there's no reason to expect it if LLVM_EXTERNAL_<proj>_SOURCE_DIR is
set. Honor that setting if it exists and allow the build configuration
to continue.

Differential Revision: https://reviews.llvm.org/D49672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354693 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index 418dfa8bc3c5ffc923b80576744faf42c1305fbb..a62c753647c3b202b2dd2fc2d21242ccbec80bdf 100644 (file)
@@ -140,7 +140,7 @@ if (LLVM_ENABLE_PROJECTS_USED OR NOT LLVM_ENABLE_PROJECTS STREQUAL "")
       if(NOT EXISTS "${PROJ_DIR}" OR NOT IS_DIRECTORY "${PROJ_DIR}")
         message(FATAL_ERROR "LLVM_ENABLE_PROJECTS requests ${proj} but directory not found: ${PROJ_DIR}")
       endif()
-      set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}")
+      set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}" CACHE STRING "")
     else()
       message(STATUS "${proj} project is disabled")
       set(SHOULD_ENABLE_PROJECT FALSE)