From b36b3e54482332b2cc4d4f453a9c7304ec8e5e5b Mon Sep 17 00:00:00 2001
From: Chris Bieneman <beanz@apple.com>
Date: Wed, 10 Feb 2016 01:09:59 +0000
Subject: [PATCH] [CMake] Pass LLVM_EXTERNAL_*_SOURCE_DIR variables to
 subsequent stages

For multi-stage builds we need to pass any overridden source directory variables. Without passing these the subsequent stages won't find the project sources.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260341 91177308-0d34-0410-b5e6-96231b3b80d8
---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7542bb46160..96f771b2155 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -735,6 +735,10 @@ if (CLANG_ENABLE_BOOTSTRAP)
       list(APPEND PASSTHROUGH_VARIABLES
         -D${varName}=${value})
     endif()
+    if(${variableName} AND variableName MATCHES "LLVM_EXTERNAL_.*_SOURCE_DIR")
+      list(APPEND PASSTHROUGH_VARIABLES
+        -D${variableName}=${${variableName}})
+    endif()
   endforeach()
 
   # Populate the passthrough variables
-- 
GitLab