Skip to content

Commit 46c98b8

Browse files
committed
[cmake] Add diagnostic message for MSVC_DIA_SDK_DIR edge case
It is technically possible that MSVC_DIA_SDK_DIR could not be inferred from LLVM_WINSYSROOT or VSINSTALLDIR. In that case, don't attempt to set it to a broken path at all, and emit a diagnostic message instead. Signed-off-by: Ruoyu Zhong <[email protected]>
1 parent 26dcab1 commit 46c98b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/cmake/modules/FindDIASDK.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ endif()
2121
if(LLVM_WINSYSROOT)
2222
set(MSVC_DIA_SDK_DIR "${LLVM_WINSYSROOT}/DIA SDK" CACHE PATH
2323
"Path to the DIA SDK")
24-
else()
24+
elseif($ENV{VSINSTALLDIR})
2525
set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK" CACHE PATH
2626
"Path to the DIA SDK")
27+
elseif(NOT DEFINED MSVC_DIA_SDK_DIR)
28+
message(STATUS "MSVC_DIA_SDK_DIR not set, and could not be inferred. DIA SDK "
29+
"may not be found.")
2730
endif()
2831

2932
find_path(DIASDK_INCLUDE_DIR

0 commit comments

Comments
 (0)