From 174f0bb07a20e0486ae3f1d0f0d4bf9437934b6b Mon Sep 17 00:00:00 2001 From: Ashley Ruglys Date: Tue, 6 Feb 2024 21:27:31 +1300 Subject: [PATCH] Allow setting a custom dir to pull the clang includes from --- bbl/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bbl/CMakeLists.txt b/bbl/CMakeLists.txt index 21f0cf7..5a1876e 100644 --- a/bbl/CMakeLists.txt +++ b/bbl/CMakeLists.txt @@ -147,20 +147,24 @@ install( ${CMAKE_INSTALL_LIBDIR}/cmake/babble ) +if(NOT DEFINED LIBCLANG_DIR) + set(LIBCLANG_DIR ${CLANG_INSTALL_PREFIX}) +endif() + # copy the clang resource dir to the installation so we can pick up the headers # first need to extract the major version to get the right path from the # llvm installation install( DIRECTORY - ${CLANG_INSTALL_PREFIX}/lib/clang/${LLVM_VERSION_MAJOR}/include + ${LIBCLANG_DIR}/lib/clang/${LLVM_VERSION_MAJOR}/include DESTINATION ${CMAKE_INSTALL_LIBDIR}/resource ) # also copy it to the binary dir so we can pick it up in the test runner file( - COPY - ${CLANG_INSTALL_PREFIX}/lib/clang/${LLVM_VERSION_MAJOR}/include + COPY + ${LIBCLANG_DIR}/lib/clang/${LLVM_VERSION_MAJOR}/include DESTINATION ${CMAKE_BINARY_DIR} -) \ No newline at end of file +)