From ef02add4a139cfc563945108b19167c1e3b138f7 Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Wed, 13 Jul 2016 17:15:31 +0200 Subject: [PATCH] Better fix for ROOT-8267 --- interpreter/cling/CMakeLists.txt | 9 +++++++-- interpreter/llvm/Module.mk | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/interpreter/cling/CMakeLists.txt b/interpreter/cling/CMakeLists.txt index eb96d9f8aeba8..2e3de36f83443 100644 --- a/interpreter/cling/CMakeLists.txt +++ b/interpreter/cling/CMakeLists.txt @@ -313,12 +313,17 @@ endmacro(add_cling_executable) set(CMAKE_INCLUDE_CURRENT_DIR ON) if(DEFINED ROOT_BINARY_DIR) - # Building as part of ROOT. - # this is needed when building Cling as part of ROOT: + # Building as part of ROOT (CMake) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/../llvm/src/tools/clang/include ${CMAKE_CURRENT_SOURCE_DIR}/../llvm/src/tools/clang/include ) +elseif(DEFINED ROOT_CLASSIC) + # Building as part of ROOT (classic) + include_directories(BEFORE + ${CMAKE_CURRENT_BINARY_DIR}/../llvm/obj/tools/clang/include + ${CMAKE_CURRENT_SOURCE_DIR}/../llvm/src/tools/clang/include + ) else() # and this when building Cling standalone: include_directories(BEFORE diff --git a/interpreter/llvm/Module.mk b/interpreter/llvm/Module.mk index d93e2e03a69cd..349aba7c70f4b 100644 --- a/interpreter/llvm/Module.mk +++ b/interpreter/llvm/Module.mk @@ -5,7 +5,7 @@ MODNAME := llvm MODDIR := $(ROOT_SRCDIR)/interpreter/$(MODNAME) -LLVMDIRO := $(call stripsrc,$(MODDIR)/src) +LLVMDIRO := $(call stripsrc,$(MODDIR)/obj) LLVMDIRI := $(call stripsrc,$(MODDIR)/inst) ifneq ($(BUILTINLLVM),yes) @@ -186,7 +186,7 @@ $(LLVMDEPO): $(LLVMDEPS) $$LLVM_HOST \ $$LLVM_TARGET \ -DCMAKE_INSTALL_PREFIX=$(ROOT_OBJDIR)/$(LLVMDIRI) \ - -DROOT_BINARY_DIR=$(ROOT_OBJDIR) \ + -DROOT_CLASSIC=ON \ -DLLVM_BUILD_DOCS=OFF \ -DLLVM_BUILD_TESTS=OFF \ -DLLVM_ENABLE_WARNINGS=ON \