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)
144144 endif ()
145145endif ()
146146
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)
148150 message (STATUS "SPIRV-Tools not found; project will be built without "
149151 "--spirv-tools-dis support." )
150152endif ()
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:
9797### Build with SPIRV-Tools
9898
9999The 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.
100101If SPIRV-Tools have been installed prior to the build it will be detected and
101102used automatically. However it is also possible to enable use of SPIRV-Tools
102103from 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)
3131 endif ()
3232
3333 set (SPIRV_TOOLS_BINDIR "${SPIRV_TOOLS_PREFIX} /bin" )
34+ if (LLVM_SPIRV_ENABLE_LIBSPIRV_DIS)
35+ set (SPIRV_ENABLE_LIBSPIRV_DIS ON )
36+ endif ()
3437elseif (SPIRV-Tools-tools_FOUND)
3538 # we found SPIRV-Tools via cmake targets
3639
Original file line number Diff line number Diff line change 2121# excludes: A list of directories and fles to exclude from the testsuite.
2222config .excludes = ['CMakeLists.txt' ]
2323
24- if config .spirv_tools_found :
24+ if config .libspirv_dis :
2525 config .available_features .add ('libspirv_dis' )
2626
2727if 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@"
1919config.python_executable = "@PYTHON_EXECUTABLE@"
2020config.test_run_dir = "@CMAKE_CURRENT_BINARY_DIR@"
2121config.spirv_tools_found = "@SPIRV_TOOLS_FOUND@"
22+ config.libspirv_dis = "@SPIRV_ENABLE_LIBSPIRV_DIS@"
2223config.spirv_tools_have_spirv_as = @SPIRV_TOOLS_SPIRV_AS_FOUND@
2324config.spirv_tools_have_spirv_dis = @SPIRV_TOOLS_SPIRV_DIS_FOUND@
2425config.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
3232 ${LLVM_SPIRV_INCLUDE_DIRS}
3333)
3434
35- if (SPIRV_TOOLS_FOUND)
35+ if (SPIRV_TOOLS_FOUND AND LLVM_SPIRV_ENABLE_LIBSPIRV_DIS )
3636 target_compile_definitions (llvm-spirv PRIVATE LLVM_SPIRV_HAVE_SPIRV_TOOLS=1)
3737 target_include_directories (llvm-spirv PRIVATE ${SPIRV_TOOLS_INCLUDE_DIRS} )
3838 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