From 2d099cd8c5cb1598d6e911c0b389132ebc7c101b Mon Sep 17 00:00:00 2001 From: Dale Hamel Date: Tue, 11 Feb 2020 21:10:52 -0500 Subject: [PATCH] Allow specifying clang base directory --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bd0f3b2716c..f1916b55caa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,11 @@ find_package(LLVM REQUIRED CONFIG) message(STATUS "Found LLVM: ${LLVM_INCLUDE_DIRS} ${LLVM_PACKAGE_VERSION}") find_package(LibElf REQUIRED) +if(CLANG_DIR) + set(CMAKE_FIND_ROOT_PATH "${CLANG_DIR}") + include_directories("${CLANG_DIR}/include") +endif() + # clang is linked as a library, but the library path searching is # primitively supported, unlike libLLVM set(CLANG_SEARCH "/opt/local/llvm/lib;/usr/lib/llvm-3.7/lib;${LLVM_LIBRARY_DIRS}")