1 set(LLVM_LINK_COMPONENTS
6 find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
7 find_first_existing_vc_file("${CLANG_SOURCE_DIR}" clang_vc)
9 # The VC revision include that we want to generate.
10 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
12 set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
14 if(llvm_vc AND LLVM_APPEND_VC_REV)
15 set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})
17 if (LLVM_VC_REPOSITORY AND LLVM_VC_REVISION)
18 set(llvm_source_dir ${LLVM_SOURCE_DIR})
19 set(llvm_vc_repository ${LLVM_VC_REPOSITORY})
20 set(llvm_vc_revision ${LLVM_VC_REVISION})
22 if(clang_vc AND LLVM_APPEND_VC_REV)
23 set(clang_source_dir ${CLANG_SOURCE_DIR})
25 if (CLANG_VC_REPOSITORY AND CLANG_VC_REVISION)
26 set(clang_source_dir ${CLANG_SOURCE_DIR})
27 set(clang_vc_repository ${CLANG_VC_REPOSITORY})
28 set(clang_vc_revision ${CLANG_VC_REVISION})
31 # Create custom target to generate the VC revision include.
32 add_custom_command(OUTPUT "${version_inc}"
33 DEPENDS "${llvm_vc}" "${clang_vc}" "${generate_vcs_version_script}"
34 COMMAND ${CMAKE_COMMAND} "-DNAMES=\"LLVM;CLANG\""
35 "-DLLVM_SOURCE_DIR=${llvm_source_dir}"
36 "-DCLANG_SOURCE_DIR=${clang_source_dir}"
37 "-DCLANG_VC_REPOSITORY=${clang_vc_repository}"
38 "-DCLANG_VC_REVISION=${clang_vc_revision}"
39 "-DHEADER_FILE=${version_inc}"
40 "-DLLVM_VC_REPOSITORY=${llvm_vc_repository}"
41 "-DLLVM_VC_REVISION=${llvm_vc_revision}"
42 -P "${generate_vcs_version_script}")
44 # Mark the generated header as being generated.
45 set_source_files_properties("${version_inc}"
46 PROPERTIES GENERATED TRUE
47 HEADER_FILE_ONLY TRUE)
50 set_source_files_properties(Version.cpp
51 PROPERTIES COMPILE_DEFINITIONS "CLANG_VENDOR=\"${CLANG_VENDOR} \"")
54 add_clang_library(clangBasic
68 FileSystemStatCache.cpp
77 OperatorPrecedence.cpp
81 SanitizerSpecialCaseList.cpp
101 Targets/LoongArch.cpp
106 Targets/OSTargets.cpp
115 Targets/WebAssembly.cpp
130 target_link_libraries(clangBasic