1set(LLVM_LINK_COMPONENTS
2  Core
3  MC
4  Support
5  )
6
7find_first_existing_vc_file(llvm_vc "${LLVM_MAIN_SRC_DIR}")
8find_first_existing_vc_file(clang_vc "${CLANG_SOURCE_DIR}")
9
10# The VC revision include that we want to generate.
11set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc")
12
13set(get_svn_script "${LLVM_CMAKE_PATH}/GetSVN.cmake")
14
15if(DEFINED llvm_vc AND DEFINED clang_vc)
16  # Create custom target to generate the VC revision include.
17  add_custom_command(OUTPUT "${version_inc}"
18    DEPENDS "${llvm_vc}" "${clang_vc}" "${get_svn_script}"
19    COMMAND
20    ${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLVM_MAIN_SRC_DIR}"
21                     "-DFIRST_NAME=LLVM"
22                     "-DSECOND_SOURCE_DIR=${CLANG_SOURCE_DIR}"
23                     "-DSECOND_NAME=SVN"
24                     "-DHEADER_FILE=${version_inc}"
25                     -P "${get_svn_script}")
26
27  # Mark the generated header as being generated.
28  set_source_files_properties("${version_inc}"
29    PROPERTIES GENERATED TRUE
30               HEADER_FILE_ONLY TRUE)
31
32  # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC.
33  set_source_files_properties(Version.cpp
34    PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC")
35else()
36  # Not producing a VC revision include.
37  set(version_inc)
38
39  # Being able to force-set the SVN revision in cases where it isn't available
40  # is useful for performance tracking, and matches compatibility from autoconf.
41  if(SVN_REVISION)
42    set_source_files_properties(Version.cpp
43      PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
44  endif()
45endif()
46
47add_clang_library(clangBasic
48  Attributes.cpp
49  Builtins.cpp
50  CharInfo.cpp
51  Cuda.cpp
52  Diagnostic.cpp
53  DiagnosticIDs.cpp
54  DiagnosticOptions.cpp
55  FileManager.cpp
56  FileSystemStatCache.cpp
57  IdentifierTable.cpp
58  LangOptions.cpp
59  MemoryBufferCache.cpp
60  Module.cpp
61  ObjCRuntime.cpp
62  OpenMPKinds.cpp
63  OperatorPrecedence.cpp
64  SanitizerBlacklist.cpp
65  SanitizerSpecialCaseList.cpp
66  Sanitizers.cpp
67  SourceLocation.cpp
68  SourceManager.cpp
69  TargetInfo.cpp
70  Targets.cpp
71  Targets/AArch64.cpp
72  Targets/AMDGPU.cpp
73  Targets/ARM.cpp
74  Targets/AVR.cpp
75  Targets/BPF.cpp
76  Targets/Hexagon.cpp
77  Targets/Lanai.cpp
78  Targets/Le64.cpp
79  Targets/MSP430.cpp
80  Targets/Mips.cpp
81  Targets/NVPTX.cpp
82  Targets/Nios2.cpp
83  Targets/OSTargets.cpp
84  Targets/PNaCl.cpp
85  Targets/PPC.cpp
86  Targets/RISCV.cpp
87  Targets/SPIR.cpp
88  Targets/Sparc.cpp
89  Targets/SystemZ.cpp
90  Targets/TCE.cpp
91  Targets/WebAssembly.cpp
92  Targets/X86.cpp
93  Targets/XCore.cpp
94  TokenKinds.cpp
95  Version.cpp
96  VersionTuple.cpp
97  VirtualFileSystem.cpp
98  Warnings.cpp
99  XRayLists.cpp
100  ${version_inc}
101  )
102
103