[compiler-rt] [llvm] [cmake] Refactor DIA SDK detection into FindDIASDK module (PR #160354)
Saleem Abdulrasool via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 24 14:09:41 PDT 2025
================
@@ -0,0 +1,77 @@
+# Finds the Microsoft DIA SDK and sets DIASDK_FOUND and related variables.
+#
+# This module is intended to be used both internally by LLVM's build system and
+# by consuming projects when loading LLVMConfig.cmake.
+#
+# LLVM_WINSYSROOT may be set for locating the DIA SDK.
+#
+# If successful, the following variables will be defined:
+# DIASDK_FOUND
+# DIASDK_INCLUDE_DIR
+# DIASDK_LIBRARIES
+#
+# Additionally, the following import target will be defined:
+# DIASDK::Diaguids
+
+if(NOT WIN32)
+ set(DIASDK_FOUND FALSE)
+ return()
+endif()
+
+if(LLVM_WINSYSROOT)
+ set(MSVC_DIA_SDK_DIR "${LLVM_WINSYSROOT}/DIA SDK" CACHE PATH
+ "Path to the DIA SDK")
+elseif($ENV{VSINSTALLDIR})
+ set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK" CACHE PATH
+ "Path to the DIA SDK")
+elseif(NOT DEFINED MSVC_DIA_SDK_DIR)
+ message(STATUS "MSVC_DIA_SDK_DIR not set, and could not be inferred. DIA SDK "
----------------
compnerd wrote:
Should this use `SEND_WARNING`?
https://github.com/llvm/llvm-project/pull/160354
More information about the llvm-commits
mailing list