Skip to content

Commit 987d935

Browse files
tuliomagainull
authored andcommitted
Fix standalone builds with LLVM_LINK_LLVM_DYLIB=ON (#1889)
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
1 parent 5eb8fe8 commit 987d935

File tree

1 file changed

+14
-33
lines changed

1 file changed

+14
-33
lines changed

llvm-spirv/lib/SPIRV/CMakeLists.txt

+14-33
Original file line numberDiff line numberDiff line change
@@ -38,42 +38,23 @@ set(SRC_LIST
3838
libSPIRV/SPIRVType.cpp
3939
libSPIRV/SPIRVValue.cpp
4040
)
41-
if(LLVM_LINK_LLVM_DYLIB)
42-
add_llvm_library(LLVMSPIRVLib STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
43-
${SRC_LIST}
44-
DEPENDS
45-
intrinsics_gen
46-
LLVMAnalysis
47-
LLVMBitWriter
48-
LLVMCodeGen
49-
LLVMCore
50-
LLVMDemangle
51-
LLVMIRReader
52-
LLVMLinker
53-
LLVMPasses
54-
LLVMSupport
55-
LLVMTargetParser
56-
LLVMTransformUtils
57-
)
58-
else()
59-
add_llvm_library(LLVMSPIRVLib
60-
${SRC_LIST}
61-
LINK_COMPONENTS
62-
Analysis
63-
BitWriter
64-
CodeGen
65-
Core
66-
Demangle
67-
IRReader
68-
Linker
69-
Passes
70-
Support
71-
TargetParser
72-
TransformUtils
41+
add_llvm_library(LLVMSPIRVLib
42+
${SRC_LIST}
43+
LINK_COMPONENTS
44+
Analysis
45+
BitWriter
46+
CodeGen
47+
Core
48+
Demangle
49+
IRReader
50+
Linker
51+
Passes
52+
Support
53+
TargetParser
54+
TransformUtils
7355
DEPENDS
7456
intrinsics_gen
7557
)
76-
endif()
7758

7859
target_include_directories(LLVMSPIRVLib
7960
PRIVATE

0 commit comments

Comments
 (0)