Skip to content

Commit 2a7588b

Browse files
authored
Changes to support SPIRV build on windows (llvm#1946)
- Make sure SPIRV can be referenced if it is built as an external project - Tweak include directories, which is also needed if SPIRV is built as an external project Co-authored-by: Konstantin Zhuravlyov <[email protected]>
1 parent 640cb90 commit 2a7588b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

amd/comgr/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ else()
123123
${LLVM_EXTERNAL_LLD_SOURCE_DIR}/include
124124
${LLVM_BINARY_DIR}/tools/lld/include)
125125
endif()
126+
127+
if (LLVM_EXTERNAL_SPIRV_LLVM_TRANSLATOR_SOURCE_DIR)
128+
target_include_directories(amd_comgr
129+
PRIVATE
130+
${LLVM_EXTERNAL_SPIRV_LLVM_TRANSLATOR_SOURCE_DIR}/include)
131+
endif()
126132
endif()
127133

128134
target_include_directories(amd_comgr
@@ -187,6 +193,9 @@ if(${COMGR_DISABLE_SPIRV})
187193
message("-- Comgr SPIRV Disabled")
188194
else()
189195
message("-- Comgr SPIRV Enabled")
196+
target_include_directories(amd_comgr
197+
PRIVATE
198+
"${LLVM_INCLUDE_DIRS}/LLVMSPIRVLib")
190199
endif()
191200

192201

amd/comgr/src/comgr-spirv-command.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef COMGR_DISABLE_SPIRV
1818
#include "comgr-diagnostic-handler.h"
1919

20-
#include <LLVMSPIRVLib/LLVMSPIRVLib.h>
20+
#include <LLVMSPIRVLib.h>
2121
#include <llvm/Bitcode/BitcodeWriter.h>
2222
#include <llvm/IR/LLVMContext.h>
2323

0 commit comments

Comments
 (0)