Skip to content

Commit

Permalink
[CI][Windows] Workaround for error in FindLLVM
Browse files Browse the repository at this point in the history
This is a workaround for an upstream LLVM issue [0], in which
the `CMAKE_INSTALL_LIBDIR` variable is used before definition.
While there is an LLVM PR to resolve this fix [1], as of
2024-08-19 it has not yet been merged to LLVM.

[0] llvm/llvm-project#83802
[1] llvm/llvm-project#83807

Co-authored-by: Eric Lunderberg <Lunderberg@users.noreply.github.com>
  • Loading branch information
Hzfengsy and Lunderberg committed Sep 24, 2024
1 parent 2a87c4c commit 9dcec81
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmake/utils/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ macro(find_llvm use_llvm)
endif()

if(${LLVM_CONFIG} MATCHES ${IS_TRUE_PATTERN})
# This is a workaround for an upstream LLVM issue [0], in which
# the `CMAKE_INSTALL_LIBDIR` variable is used before definition.
# While there is an LLVM PR to resolve this fix [1], as of
# 2024-08-19 it has not yet been merged to LLVM.
#
# [0] https://github.com/llvm/llvm-project/issues/83802
# [1] https://github.com/llvm/llvm-project/pull/83807
include(GNUInstallDirs)

find_package(LLVM ${llvm_version_required} REQUIRED CONFIG)
llvm_map_components_to_libnames(LLVM_LIBS "all")
if (NOT LLVM_LIBS)
Expand Down

0 comments on commit 9dcec81

Please sign in to comment.