Skip to content

Commit

Permalink
[libclc] Restore linking against dynamic libLLVM for out-of-tree builds
Browse files Browse the repository at this point in the history
This fixes a regression where building against an installation without
the static libraries would fail. This just reinstates the old behaviour
for out-of-tree builds, assuming that in-tree builds (which still aren't
officially supported) will have the static libraries available. We can
refine this as we move towards supporting in-tree builds.
  • Loading branch information
frasercrmck committed Apr 8, 2024
1 parent 170c525 commit 8461d90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ set(LLVM_LINK_COMPONENTS
IRReader
Support
)
add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp )
else()
add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
endif()
target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
# These were not properly reported in early LLVM and we don't need them
target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
Expand Down

0 comments on commit 8461d90

Please sign in to comment.