Skip to content

Commit 2e53d00

Browse files
committed
[Comgr][SPIRV] Switch check from INCLUDE_FILE_CXX to EXISTS (llvm#461)
The previous INCLUDE_FILE_CXX check did not work correctly, and always returned false. Checking EXISTS instead gives us the expected behavior
1 parent 06503f2 commit 2e53d00

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

amd/comgr/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,12 @@ message("")
177177
option(COMGR_DISABLE_SPIRV "To disable SPIRV in Comgr" OFF)
178178

179179
if (NOT COMGR_DISABLE_SPIRV)
180-
CHECK_INCLUDE_FILE_CXX(LLVMSPIRVLib/LLVMSPIRVLib.h HAVE_LLVMSPIRVLIB_H)
181-
if (NOT HAVE_LLVMSPIRVLIB_H)
180+
# TODO: Explore switching this to CHECK_INCLUDE_FILE_CXX() macro
181+
if (NOT EXISTS "${LLVM_INCLUDE_DIRS}/LLVMSPIRVLib/LLVMSPIRVLib.h")
182+
message("-- LLVMSPIRVLib/LLVMSPIRVLib.h not found")
182183
set(COMGR_DISABLE_SPIRV ON)
184+
else()
185+
message("-- LLVMSPIRVLib/LLVMSPIRVLib.h found")
183186
endif()
184187
endif()
185188

0 commit comments

Comments
 (0)