Skip to content

Commit 4447e58

Browse files
fineg74dbudanov-cmplr
authored andcommitted
Add support for toolchain compilation with LLVM_LINK_LLVM_DYLIB option (#1543)
Original commit: KhronosGroup/SPIRV-LLVM-Translator@40fd741
1 parent 40b32c3 commit 4447e58

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

llvm-spirv/lib/SPIRV/CMakeLists.txt

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_llvm_library(LLVMSPIRVLib
1+
set(SRC_LIST
22
LLVMSPIRVOpts.cpp
33
LLVMToSPIRVDbgTran.cpp
44
Mangler/FunctionDescriptor.cpp
@@ -36,20 +36,41 @@ add_llvm_library(LLVMSPIRVLib
3636
libSPIRV/SPIRVStream.cpp
3737
libSPIRV/SPIRVType.cpp
3838
libSPIRV/SPIRVValue.cpp
39-
LINK_COMPONENTS
40-
Analysis
41-
BitWriter
42-
CodeGen
43-
Core
44-
Demangle
45-
IRReader
46-
Linker
47-
Passes
48-
Support
49-
TransformUtils
39+
)
40+
if(LLVM_LINK_LLVM_DYLIB)
41+
add_llvm_library(LLVMSPIRVLib STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
42+
${SRC_LIST}
43+
DEPENDS
44+
intrinsics_gen
45+
LLVMAnalysis
46+
LLVMBitWriter
47+
LLVMCodeGen
48+
LLVMCore
49+
LLVMDemangle
50+
LLVMIRReader
51+
LLVMLinker
52+
LLVMPasses
53+
LLVMSupport
54+
LLVMTransformUtils
55+
)
56+
else()
57+
add_llvm_library(LLVMSPIRVLib
58+
${SRC_LIST}
59+
LINK_COMPONENTS
60+
Analysis
61+
BitWriter
62+
CodeGen
63+
Core
64+
Demangle
65+
IRReader
66+
Linker
67+
Passes
68+
Support
69+
TransformUtils
5070
DEPENDS
5171
intrinsics_gen
52-
)
72+
)
73+
endif()
5374

5475
target_include_directories(LLVMSPIRVLib
5576
PRIVATE

0 commit comments

Comments
 (0)