Skip to content

Commit a6fe953

Browse files
berolinuxjsji
authored andcommitted
Fix LLVM_SPIRV_BACKEND_TARGET_PRESENT detection when building inside the LLVM tree (#3218)
Fixes part 2 of #3217 Signed-off-by: Bernhard Rosenkränzer <[email protected]> Original commit: KhronosGroup/SPIRV-LLVM-Translator@422d907dcfd9fe0
1 parent 539d96b commit a6fe953

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm-spirv/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,6 @@ if(LLVM_SPIRV_BUILD_EXTERNAL)
102102

103103
message(STATUS "Found LLVM: ${LLVM_VERSION}")
104104

105-
is_llvm_target_library("SPIRV" spirv_present_result INCLUDED_TARGETS)
106-
if(spirv_present_result)
107-
message(STATUS "Found SPIR-V Backend")
108-
set(SPIRV_BACKEND_FOUND TRUE)
109-
add_compile_definitions(LLVM_SPIRV_BACKEND_TARGET_PRESENT)
110-
endif()
111-
112105
option(CCACHE_ALLOWED "allow use of ccache" TRUE)
113106
find_program(CCACHE_EXE_FOUND ccache)
114107
if(CCACHE_EXE_FOUND AND CCACHE_ALLOWED)
@@ -118,6 +111,13 @@ if(LLVM_SPIRV_BUILD_EXTERNAL)
118111
endif()
119112
endif()
120113

114+
is_llvm_target_library("SPIRV" spirv_present_result INCLUDED_TARGETS)
115+
if(spirv_present_result)
116+
message(STATUS "Found SPIR-V Backend")
117+
set(SPIRV_BACKEND_FOUND TRUE)
118+
add_compile_definitions(LLVM_SPIRV_BACKEND_TARGET_PRESENT)
119+
endif()
120+
121121
set(LLVM_SPIRV_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
122122

123123
# first try locating SPIRV-Tools via pkgconfig (the old way)

0 commit comments

Comments
 (0)