Skip to content

Commit

Permalink
Support disabling llvm path
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed May 6, 2024
1 parent cbccccf commit 29801f8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ message( LLVM_SHLIBEXT = ${LLVM_SHLIBEXT} )

set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")

get_filename_component(LLVM_ABSOLUTE_DIR
"${LLVM_DIR}"
REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")
option(ENZYME_REWRITE_ABSOLUTE_LLVM "Rewrite LLVM path to be absolute" ON)

if (ENZYME_REWRITE_ABSOLUTE_LLVM)
get_filename_component(LLVM_ABSOLUTE_DIR
"${LLVM_DIR}"
REALPATH BASE_DIR "${CMAKE_BINARY_DIR}")

set(LLVM_DIR "${LLVM_ABSOLUTE_DIR}" CACHE FILEPATH "b" FORCE)
set(LLVM_DIR "${LLVM_ABSOLUTE_DIR}" CACHE FILEPATH "b" FORCE)
end()

if (EXISTS "${LLVM_DIR}/lib/cmake/llvm/LLVMConfig.cmake")
set(LLVM_DIR "${LLVM_DIR}/lib/cmake/llvm")
Expand Down

0 comments on commit 29801f8

Please sign in to comment.