Skip to content

Commit c456ff0

Browse files
fineg74vmustya
authored andcommitted
Add support for LLVM_LINK_LLVM_DYLIB option
Toolchain build used to fail when LLVM_LINK_LLVM_DYLIB is enabled
1 parent 984bb27 commit c456ff0

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

GenXIntrinsics/lib/GenXIntrinsics/CMakeLists.txt

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,32 @@ else()
3838
${LLVM_COMPONENTS}
3939
)
4040

41-
add_llvm_library(LLVMGenXIntrinsics
42-
${SRC_LIST}
43-
44-
ADDITIONAL_HEADER_DIRS
45-
${GENX_INTRINSICS_MAIN_INCLUDE_DIR}/llvm/GenXIntrinsics
46-
DEPENDS
47-
GenXIntrinsicsGen
48-
intrinsics_gen
49-
)
41+
if(LLVM_LINK_LLVM_DYLIB)
42+
add_llvm_library(LLVMGenXIntrinsics STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
43+
${SRC_LIST}
44+
45+
ADDITIONAL_HEADER_DIRS
46+
${GENX_INTRINSICS_MAIN_INCLUDE_DIR}/llvm/GenXIntrinsics
47+
DEPENDS
48+
GenXIntrinsicsGen
49+
intrinsics_gen
50+
LLVMCodeGen
51+
LLVMSupport
52+
LLVMCore
53+
LLVMAnalysis
54+
LLVMSPIRVLib
55+
)
56+
else()
57+
add_llvm_library(LLVMGenXIntrinsics
58+
${SRC_LIST}
59+
60+
ADDITIONAL_HEADER_DIRS
61+
${GENX_INTRINSICS_MAIN_INCLUDE_DIR}/llvm/GenXIntrinsics
62+
DEPENDS
63+
GenXIntrinsicsGen
64+
intrinsics_gen
65+
)
66+
endif()
5067
endif()
5168

5269
target_include_directories(LLVMGenXIntrinsics PUBLIC

0 commit comments

Comments
 (0)