From 64c0ff16c593a000aeb2f2ad803173184fb8d404 Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Fri, 15 Nov 2024 13:58:06 -0500 Subject: [PATCH] cmake: handle separate prefix for LLVM/MLIR/clang Some Linux distributions (i.e. NixOS) install LLVM, MLIR, and clang in different prefixes. On these distributions, variables like `LLVM_INCLUDE_DIRS` and `MLIR_INCLUDE_DIRS` have different values. Signed-off-by: Andrew Pan --- CMakeLists.txt | 1 + tools/vast-front/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 326e96d37d..7045d8fd7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,7 @@ include(AddMLIR) include(HandleLLVMOptions) include_directories(${LLVM_INCLUDE_DIRS}) +include_directories(${MLIR_INCLUDE_DIRS}) separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS}) diff --git a/tools/vast-front/CMakeLists.txt b/tools/vast-front/CMakeLists.txt index 6312594423..68f5b40988 100644 --- a/tools/vast-front/CMakeLists.txt +++ b/tools/vast-front/CMakeLists.txt @@ -8,7 +8,7 @@ add_vast_executable(vast-front ${CLANG_LIBS} ) -set(CLANG_BIN_PATH ${LLVM_BINARY_DIR}/bin/clang) +set(CLANG_BIN_PATH ${CLANG_INSTALL_PREFIX}/bin/clang) if(NOT EXISTS ${CLANG_BIN_PATH}) message(FATAL_ERROR "Could not find clang binary to deduce resource path!")