1 set(LLVM_LINK_COMPONENTS
7 find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
8 find_first_existing_vc_file("${CLANG_SOURCE_DIR}" clang_vc)
10 # The VC revision include that we want to generate.
11 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
13 set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
15 if(llvm_vc AND LLVM_APPEND_VC_REV)
16 set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})
18 if (LLVM_VC_REPOSITORY AND LLVM_VC_REVISION)
19 set(llvm_source_dir ${LLVM_SOURCE_DIR})
20 set(llvm_vc_repository ${LLVM_VC_REPOSITORY})
21 set(llvm_vc_revision ${LLVM_VC_REVISION})
23 if(clang_vc AND LLVM_APPEND_VC_REV)
24 set(clang_source_dir ${CLANG_SOURCE_DIR})
26 if (CLANG_VC_REPOSITORY AND CLANG_VC_REVISION)
27 set(clang_source_dir ${CLANG_SOURCE_DIR})
28 set(clang_vc_repository ${CLANG_VC_REPOSITORY})
29 set(clang_vc_revision ${CLANG_VC_REVISION})
32 # Create custom target to generate the VC revision include.
33 add_custom_command(OUTPUT "${version_inc}"
34 DEPENDS "${llvm_vc}" "${clang_vc}" "${generate_vcs_version_script}"
35 COMMAND ${CMAKE_COMMAND} "-DNAMES=\"LLVM;CLANG\""
36 "-DLLVM_SOURCE_DIR=${llvm_source_dir}"
37 "-DCLANG_SOURCE_DIR=${clang_source_dir}"
38 "-DCLANG_VC_REPOSITORY=${clang_vc_repository}"
39 "-DCLANG_VC_REVISION=${clang_vc_revision}"
40 "-DHEADER_FILE=${version_inc}"
41 "-DLLVM_VC_REPOSITORY=${llvm_vc_repository}"
42 "-DLLVM_VC_REVISION=${llvm_vc_revision}"
43 "-DLLVM_FORCE_VC_REVISION=${LLVM_FORCE_VC_REVISION}"
44 "-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}"
45 -P "${generate_vcs_version_script}")
47 # Mark the generated header as being generated.
48 set_source_files_properties("${version_inc}"
49 PROPERTIES GENERATED TRUE
50 HEADER_FILE_ONLY TRUE)
53 set_source_files_properties(Version.cpp
54 PROPERTIES COMPILE_DEFINITIONS "CLANG_VENDOR=\"${CLANG_VENDOR} \"")
57 add_clang_library(clangBasic
58 ASTSourceDescriptor.cpp
72 FileSystemStatCache.cpp
81 OperatorPrecedence.cpp
85 SanitizerSpecialCaseList.cpp
92 StackExhaustionHandler.cpp
106 Targets/LoongArch.cpp
111 Targets/OSTargets.cpp
120 Targets/WebAssembly.cpp
134 # These generated headers are included transitively.
135 ARMTargetParserTableGen
136 AArch64TargetParserTableGen
139 target_link_libraries(clangBasic