File tree Expand file tree Collapse file tree 6 files changed +11
-4
lines changed Expand file tree Collapse file tree 6 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,9 @@ if (NOT SPIRV_TOOLS_FOUND)
144
144
endif ()
145
145
endif ()
146
146
147
- if (NOT SPIRV_TOOLS_FOUND )
147
+ option (LLVM_SPIRV_ENABLE_LIBSPIRV_DIS "Enable --spirv-tools-dis support." )
148
+
149
+ if (NOT SPIRV_TOOLS_FOUND AND LLVM_SPIRV_ENABLE_LIBSPIRV_DIS )
148
150
message (STATUS "SPIRV-Tools not found; project will be built without "
149
151
"--spirv-tools-dis support." )
150
152
endif ()
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ Building clang from sources takes time and resources and it can be avoided:
97
97
### Build with SPIRV-Tools
98
98
99
99
The translator can use [ SPIRV-Tools] ( https://github.com/KhronosGroup/SPIRV-Tools ) to generate assembly with widely adopted syntax.
100
+ This feature can be enabled by passing ` -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=ON ` option.
100
101
If SPIRV-Tools have been installed prior to the build it will be detected and
101
102
used automatically. However it is also possible to enable use of SPIRV-Tools
102
103
from a custom location using the following instructions:
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ if(SPIRV_TOOLS_FOUND AND NOT SPIRV-Tools-tools_FOUND)
31
31
endif ()
32
32
33
33
set (SPIRV_TOOLS_BINDIR "${SPIRV_TOOLS_PREFIX} /bin" )
34
+ if (LLVM_SPIRV_ENABLE_LIBSPIRV_DIS )
35
+ set (SPIRV_ENABLE_LIBSPIRV_DIS ON )
36
+ endif ()
34
37
elseif (SPIRV-Tools-tools_FOUND )
35
38
# we found SPIRV-Tools via cmake targets
36
39
Original file line number Diff line number Diff line change 21
21
# excludes: A list of directories and fles to exclude from the testsuite.
22
22
config .excludes = ['CMakeLists.txt' ]
23
23
24
- if config .spirv_tools_found :
24
+ if config .libspirv_dis :
25
25
config .available_features .add ('libspirv_dis' )
26
26
27
27
if not config .spirv_skip_debug_info_tests :
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ config.host_arch = "@HOST_ARCH@"
19
19
config.python_executable = "@PYTHON_EXECUTABLE@"
20
20
config.test_run_dir = "@CMAKE_CURRENT_BINARY_DIR@"
21
21
config.spirv_tools_found = "@SPIRV_TOOLS_FOUND@"
22
+ config.libspirv_dis = "@SPIRV_ENABLE_LIBSPIRV_DIS@"
22
23
config.spirv_tools_have_spirv_as = @SPIRV_TOOLS_SPIRV_AS_FOUND@
23
24
config.spirv_tools_have_spirv_dis = @SPIRV_TOOLS_SPIRV_DIS_FOUND@
24
25
config.spirv_tools_have_spirv_link = @SPIRV_TOOLS_SPIRV_LINK_FOUND@
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ target_include_directories(llvm-spirv
32
32
${LLVM_SPIRV_INCLUDE_DIRS}
33
33
)
34
34
35
- if (SPIRV_TOOLS_FOUND )
35
+ if (SPIRV_TOOLS_FOUND AND LLVM_SPIRV_ENABLE_LIBSPIRV_DIS )
36
36
target_compile_definitions (llvm-spirv PRIVATE LLVM_SPIRV_HAVE_SPIRV_TOOLS=1 )
37
37
target_include_directories (llvm-spirv PRIVATE ${SPIRV_TOOLS_INCLUDE_DIRS} )
38
38
target_link_libraries (llvm-spirv PRIVATE ${SPIRV_TOOLS_LDFLAGS} )
39
- endif (SPIRV_TOOLS_FOUND )
39
+ endif ()
You can’t perform that action at this time.
0 commit comments