llvm.org GIT mirror llvm / a50b783
[cmake] Add LLVM_ENABLE_DIA_SDK option, and expose it in LLVMConfig Add an explicit LLVM_ENABLE_DIA_SDK option to control building support for DIA SDK-based debugging. Control its value to match whether DIA SDK support was found and expose it in LLVMConfig (alike LLVM_ENABLE_ZLIB). Its value is needed for LLDB to determine whether to run tests requiring DIA support. Currently it is obtained from llvm/Config/config.h; however, this file is not available for standalone builds. Following this change, LLDB will be modified to use the value from LLVMConfig. Differential Revision: https://reviews.llvm.org/D26255 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290818 91177308-0d34-0410-b5e6-96231b3b80d8 Michal Gorny 3 years ago
7 changed file(s) with 21 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
449449 else()
450450 set(HAVE_DIA_SDK 0)
451451 endif()
452 else()
453 set(HAVE_DIA_SDK 0)
452
453 option(LLVM_ENABLE_DIA_SDK "Use MSVC DIA SDK for debugging if available."
454 ${HAVE_DIA_SDK})
455
456 if(LLVM_ENABLE_DIA_SDK AND NOT HAVE_DIA_SDK)
457 message(FATAL_ERROR "DIA SDK not found. If you have both VS 2012 and 2013 installed, you may need to uninstall the former and re-install the latter afterwards.")
458 endif()
459 else()
460 set(LLVM_ENABLE_DIA_SDK 0)
454461 endif( MSVC )
455462
456463 # FIXME: Signal handler return type, currently hardcoded to 'void'
3636
3737 set(LLVM_ENABLE_ZLIB @LLVM_ENABLE_ZLIB@)
3838
39 set(LLVM_ENABLE_DIA_SDK @LLVM_ENABLE_DIA_SDK@)
40
3941 set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)
4042
4143 set(LLVM_ENABLE_PIC @LLVM_ENABLE_PIC@)
366366 **LLVM_ENABLE_ZLIB**:BOOL
367367 Enable building with zlib to support compression/uncompression in LLVM tools.
368368 Defaults to ON.
369
370 **LLVM_ENABLE_DIA_SDK**:BOOL
371 Enable building with MSVC DIA SDK for PDB debugging support. Available
372 only with MSVC. Defaults to ON.
369373
370374 **LLVM_USE_SANITIZER**:STRING
371375 Define the sanitizer used to build LLVM binaries and tests. Possible values
3838 #cmakedefine01 HAVE_DECL_STRERROR_S
3939
4040 /* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */
41 #cmakedefine01 HAVE_DIA_SDK
41 #cmakedefine01 LLVM_ENABLE_DIA_SDK
4242
4343 /* Define to 1 if you have the header file, and it defines `DIR'.
4444 */
22 source_group(${group} FILES ${ARGN})
33 endmacro()
44
5 if(HAVE_DIA_SDK)
5 if(LLVM_ENABLE_DIA_SDK)
66 include_directories(${MSVC_DIA_SDK_DIR}/include)
77 set(LIBPDB_LINK_FOLDERS "${MSVC_DIA_SDK_DIR}\\lib")
88 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
1313 #include "llvm/DebugInfo/PDB/GenericError.h"
1414 #include "llvm/DebugInfo/PDB/IPDBSession.h"
1515 #include "llvm/DebugInfo/PDB/PDB.h"
16 #if HAVE_DIA_SDK
16 #if LLVM_ENABLE_DIA_SDK
1717 #include "llvm/DebugInfo/PDB/DIA/DIASession.h"
1818 #endif
1919 #include "llvm/DebugInfo/PDB/Raw/RawSession.h"
2929 if (Type == PDB_ReaderType::Raw)
3030 return RawSession::createFromPdb(Path, Session);
3131
32 #if HAVE_DIA_SDK
32 #if LLVM_ENABLE_DIA_SDK
3333 return DIASession::createFromPdb(Path, Session);
3434 #else
3535 return llvm::make_error("DIA is not installed on the system");
4242 if (Type == PDB_ReaderType::Raw)
4343 return RawSession::createFromExe(Path, Session);
4444
45 #if HAVE_DIA_SDK
45 #if LLVM_ENABLE_DIA_SDK
4646 return DIASession::createFromExe(Path, Session);
4747 #else
4848 return llvm::make_error("DIA is not installed on the system");
3535 config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
3636 config.have_zlib = "@HAVE_LIBZ@"
3737 config.have_libxar = "@HAVE_LIBXAR@"
38 config.have_dia_sdk = @HAVE_DIA_SDK@
38 config.have_dia_sdk = @LLVM_ENABLE_DIA_SDK@
3939 config.enable_ffi = "@LLVM_ENABLE_FFI@"
4040 config.test_examples = "@ENABLE_EXAMPLES@"
4141