Skip to content

Commit

Permalink
Fix standalone builds with LLVM_LINK_LLVM_DYLIB=ON (#1889)
Browse files Browse the repository at this point in the history
Move the LLVM components to LINK_COMPONENTS because the DEPENDS list has the same semantics as add_dependencies(). In this
case it doesn't include the LLVM components when calling the linker.

It's almost complete revert of #1543

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@cf5a5a4
  • Loading branch information
tuliom authored and againull committed Apr 17, 2023
1 parent 5eb8fe8 commit 987d935
Showing 1 changed file with 14 additions and 33 deletions.
47 changes: 14 additions & 33 deletions llvm-spirv/lib/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,23 @@ set(SRC_LIST
libSPIRV/SPIRVType.cpp
libSPIRV/SPIRVValue.cpp
)
if(LLVM_LINK_LLVM_DYLIB)
add_llvm_library(LLVMSPIRVLib STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
${SRC_LIST}
DEPENDS
intrinsics_gen
LLVMAnalysis
LLVMBitWriter
LLVMCodeGen
LLVMCore
LLVMDemangle
LLVMIRReader
LLVMLinker
LLVMPasses
LLVMSupport
LLVMTargetParser
LLVMTransformUtils
)
else()
add_llvm_library(LLVMSPIRVLib
${SRC_LIST}
LINK_COMPONENTS
Analysis
BitWriter
CodeGen
Core
Demangle
IRReader
Linker
Passes
Support
TargetParser
TransformUtils
add_llvm_library(LLVMSPIRVLib
${SRC_LIST}
LINK_COMPONENTS
Analysis
BitWriter
CodeGen
Core
Demangle
IRReader
Linker
Passes
Support
TargetParser
TransformUtils
DEPENDS
intrinsics_gen
)
endif()

target_include_directories(LLVMSPIRVLib
PRIVATE
Expand Down

0 comments on commit 987d935

Please sign in to comment.