Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix LLVM_DIR rewrite by LLVMConfig.cmake #1232

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ install(
PATTERN "**/*.h")

# Compile extapi.c to extapi.bc
find_path(LLVM_CLANG_DIR NAMES clang PATH_SUFFIXES bin)
find_path(LLVM_CLANG_DIR
NAMES clang llvm
HINTS ${LLVM_DIR} ENV LLVM_DIR
PATH_SUFFIXES bin)
add_custom_target(extapi_ir ALL
COMMAND ${LLVM_CLANG_DIR}/clang -w -S -c -Xclang -disable-O0-optnone -fno-discard-value-names -emit-llvm ${PROJECT_SOURCE_DIR}/svf-llvm/lib/extapi.c -o ${PROJECT_BINARY_DIR}/svf-llvm/extapi.bc
DEPENDS ${PROJECT_SOURCE_DIR}/svf-llvm/lib/extapi.c
Expand Down
1 change: 1 addition & 0 deletions svf-llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# building out-of-source
if(NOT COMMAND add_llvm_library)
find_package(LLVM REQUIRED CONFIG HINTS "${LLVM_DIR}")
set(LLVM_DIR ${LLVM_BINARY_DIR} PARENT_SCOPE)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
Expand Down
Loading