Skip to content

Commit

Permalink
cmake: handle separate prefix for LLVM/MLIR/clang
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tnytown authored and xlauko committed Nov 18, 2024
1 parent 18a7b74 commit 64c0ff1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
2 changes: 1 addition & 1 deletion tools/vast-front/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down

0 comments on commit 64c0ff1

Please sign in to comment.