Skip to content

Commit 8461d90

Browse files
committed
[libclc] Restore linking against dynamic libLLVM for out-of-tree builds
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.
1 parent 170c525 commit 8461d90

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libclc/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ set(LLVM_LINK_COMPONENTS
122122
IRReader
123123
Support
124124
)
125-
add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
125+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
126+
add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp )
127+
else()
128+
add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
129+
endif()
126130
target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
127131
# These were not properly reported in early LLVM and we don't need them
128132
target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )

0 commit comments

Comments
 (0)