Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -229,8 +229,25 @@ # MSVC has a gazillion warnings with this. if( MSVC ) option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." OFF) + + # See if the DIA SDK is available and usable. + set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK") + + # Due to a bug in MSVC 2013's installation software, it is possible + # for MSVC 2013 to write the DIA SDK into the Visual Studio 2012 + # install directory. If this happens, the installation is corrupt + # and there's nothing we can do. It happens with enough frequency + # though that we should handle it. We do so by simply checking that + # the DIA SDK folder exists. Should this happen you will need to + # uninstall VS 2012 and then re-install VS 2013. + if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR}) + set(LLVM_ENABLE_DIA_SDK 1) + else() + set(LLVM_ENABLE_DIA_SDK 0) + endif() else() option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) + set(LLVM_ENABLE_DIA_SDK 0) endif() option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF) Index: include/llvm/Config/config.h.in =================================================================== --- include/llvm/Config/config.h.in +++ include/llvm/Config/config.h.in @@ -537,6 +537,9 @@ /* Installation prefix directory */ #undef LLVM_PREFIX +/* Define if we have the DIA SDK */ +#undef LLVM_ENABLE_DIA_SDK + /* Define if we have the Intel JIT API runtime support library */ #undef LLVM_USE_INTEL_JITEVENTS Index: include/llvm/Config/llvm-config.h.cmake =================================================================== --- include/llvm/Config/llvm-config.h.cmake +++ include/llvm/Config/llvm-config.h.cmake @@ -80,6 +80,9 @@ /* Installation prefix directory */ #cmakedefine LLVM_PREFIX "${LLVM_PREFIX}" +/* Define if we have the DIA SDK */ +#cmakedefine LLVM_ENABLE_DIA_SDK ${LLVM_ENABLE_DIA_SDK} + /* Define if we have the Intel JIT API runtime support library */ #cmakedefine LLVM_USE_INTEL_JITEVENTS 1 Index: include/llvm/Config/llvm-config.h.in =================================================================== --- include/llvm/Config/llvm-config.h.in +++ include/llvm/Config/llvm-config.h.in @@ -83,6 +83,9 @@ /* Define if we have the Intel JIT API runtime support library */ #undef LLVM_USE_INTEL_JITEVENTS +/* Define if we have the DIA SDK */ +#undef LLVM_ENABLE_DIA_SDK + /* Define if we have the oprofile JIT-support library */ #undef LLVM_USE_OPROFILE