1macro(add_pdb_impl_folder group)
2  list(APPEND PDB_IMPL_SOURCES ${ARGN})
3  source_group(${group} FILES ${ARGN})
4endmacro()
5
6if(HAVE_DIA_SDK)
7  include_directories(${MSVC_DIA_SDK_DIR}/include)
8  set(LIBPDB_LINK_FOLDERS "${MSVC_DIA_SDK_DIR}\\lib")
9  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
10    set(LIBPDB_LINK_FOLDERS "${LIBPDB_LINK_FOLDERS}\\amd64")
11  endif()
12  file(TO_CMAKE_PATH "${LIBPDB_LINK_FOLDERS}\\diaguids.lib" LIBPDB_ADDITIONAL_LIBRARIES)
13
14  add_pdb_impl_folder(DIA
15    DIA/DIADataStream.cpp
16    DIA/DIAEnumDebugStreams.cpp
17    DIA/DIAEnumLineNumbers.cpp
18    DIA/DIAEnumSourceFiles.cpp
19    DIA/DIAEnumSymbols.cpp
20    DIA/DIAError.cpp
21    DIA/DIALineNumber.cpp
22    DIA/DIARawSymbol.cpp
23    DIA/DIASession.cpp
24    DIA/DIASourceFile.cpp
25    )
26
27    set(LIBPDB_ADDITIONAL_HEADER_DIRS "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/PDB/DIA")
28endif()
29
30add_pdb_impl_folder(Raw
31  Raw/DbiStream.cpp
32  Raw/DbiStreamBuilder.cpp
33  Raw/EnumTables.cpp
34  Raw/Hash.cpp
35  Raw/IndexedStreamData.cpp
36  Raw/InfoStream.cpp
37  Raw/InfoStreamBuilder.cpp
38  Raw/MappedBlockStream.cpp
39  Raw/ModInfo.cpp
40  Raw/ModStream.cpp
41  Raw/NameHashTable.cpp
42  Raw/NameMap.cpp
43  Raw/PDBFile.cpp
44  Raw/PDBFileBuilder.cpp
45  Raw/PublicsStream.cpp
46  Raw/RawError.cpp
47  Raw/RawSession.cpp
48  Raw/SymbolStream.cpp
49  Raw/TpiStream.cpp)
50
51list(APPEND LIBPDB_ADDITIONAL_HEADER_DIRS "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/PDB/Raw")
52list(APPEND LIBPDB_ADDITIONAL_HEADER_DIRS "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/PDB")
53
54add_llvm_library(LLVMDebugInfoPDB
55  GenericError.cpp
56  IPDBSourceFile.cpp
57  PDB.cpp
58  PDBContext.cpp
59  PDBExtras.cpp
60  PDBInterfaceAnchors.cpp
61  PDBSymbol.cpp
62  PDBSymbolAnnotation.cpp
63  PDBSymbolBlock.cpp
64  PDBSymbolCompiland.cpp
65  PDBSymbolCompilandDetails.cpp
66  PDBSymbolCompilandEnv.cpp
67  PDBSymbolCustom.cpp
68  PDBSymbolData.cpp
69  PDBSymbolExe.cpp
70  PDBSymbolFunc.cpp
71  PDBSymbolFuncDebugEnd.cpp
72  PDBSymbolFuncDebugStart.cpp
73  PDBSymbolLabel.cpp
74  PDBSymbolPublicSymbol.cpp
75  PDBSymbolThunk.cpp
76  PDBSymbolTypeArray.cpp
77  PDBSymbolTypeBaseClass.cpp
78  PDBSymbolTypeBuiltin.cpp
79  PDBSymbolTypeCustom.cpp
80  PDBSymbolTypeDimension.cpp
81  PDBSymbolTypeEnum.cpp
82  PDBSymbolTypeFriend.cpp
83  PDBSymbolTypeFunctionArg.cpp
84  PDBSymbolTypeFunctionSig.cpp
85  PDBSymbolTypeManaged.cpp
86  PDBSymbolTypePointer.cpp
87  PDBSymbolTypeTypedef.cpp
88  PDBSymbolTypeUDT.cpp
89  PDBSymbolTypeVTable.cpp
90  PDBSymbolTypeVTableShape.cpp
91  PDBSymbolUnknown.cpp
92  PDBSymbolUsingNamespace.cpp
93  PDBSymDumper.cpp
94  ${PDB_IMPL_SOURCES}
95
96  ADDITIONAL_HEADER_DIRS
97  ${LIBPDB_ADDITIONAL_HEADER_DIRS}
98  )
99
100target_link_libraries(LLVMDebugInfoPDB INTERFACE "${LIBPDB_ADDITIONAL_LIBRARIES}")
101