forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
33 lines (29 loc) · 795 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set(LLVM_LINK_COMPONENTS
SPIRVLib
Analysis
BitReader
BitWriter
Core
Passes
Support
TargetParser
TransformUtils
)
add_llvm_tool(llvm-spirv
llvm-spirv.cpp
# llvm_setup_rpath messes with the rpath making llvm-spirv not executable from the build directory
NO_INSTALL_RPATH
)
if (LLVM_SPIRV_BUILD_EXTERNAL OR LLVM_LINK_LLVM_DYLIB)
target_link_libraries(llvm-spirv PRIVATE LLVMSPIRVLib)
endif()
target_include_directories(llvm-spirv
PRIVATE
${LLVM_INCLUDE_DIRS}
${LLVM_SPIRV_INCLUDE_DIRS}
)
if(SPIRV_TOOLS_FOUND)
target_compile_definitions(llvm-spirv PRIVATE LLVM_SPIRV_HAVE_SPIRV_TOOLS=1)
target_include_directories(llvm-spirv PRIVATE ${SPIRV_TOOLS_INCLUDE_DIRS})
target_link_libraries(llvm-spirv PRIVATE ${SPIRV_TOOLS_LDFLAGS})
endif(SPIRV_TOOLS_FOUND)