Skip to content

Commit

Permalink
Ensure LLD matches proteus
Browse files Browse the repository at this point in the history
  • Loading branch information
ggeorgakoudis committed Jan 22, 2025
1 parent 645ff03 commit 8e0910d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cmake/proteusConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
@PACKAGE_INIT@

set(PROTEUS_LLVM_DIR @LLVM_DIR@)
find_package(LLVM REQUIRED CONFIG)
set(PROTEUS_LLVM_DIR "@LLVM_DIR@")
set(PROTEUS_LLD_DIR "@LLD_DIR@")
find_dependency(LLVM REQUIRED CONFIG)

if (NOT "${LLVM_DIR}" STREQUAL "${PROTEUS_LLVM_DIR}")
message(FATAL_ERROR "Mismatch between target LLVM_DIR = ${LLVM_DIR} "
"and Proteus LLVM_DIR = ${PROTEUS_LLVM_DIR}. "
"Use the same LLVM installation when compiling.")
endif()
find_package(LLD REQUIRED)
message(STATUS "LLVM DIR = ${LLVM_DIR}")

get_property(enabled_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
message(STATUS "Enabled languages: ${enabled_languages}")
if("HIP" IN_LIST enabled_languages)
find_dependency(LLD NO_DEFAULT_PATH PATHS ${PROTEUS_LLD_DIR} REQUIRED)
message(STATUS "LLD DIR = ${LLD_DIR}")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/proteusTargets.cmake")
check_required_components("@PROJECT_NAME@")
Expand Down

0 comments on commit 8e0910d

Please sign in to comment.