2013-12-10 03:04:43 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
2014-10-16 08:12:02 +08:00
|
|
|
Core
|
2013-12-10 03:04:43 +08:00
|
|
|
MC
|
|
|
|
Support
|
|
|
|
)
|
2011-02-12 07:46:38 +08:00
|
|
|
|
2019-02-06 11:51:00 +08:00
|
|
|
find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
|
|
|
|
find_first_existing_vc_file("${CLANG_SOURCE_DIR}" clang_vc)
|
2014-11-20 06:03:48 +08:00
|
|
|
|
2014-12-06 06:32:49 +08:00
|
|
|
# The VC revision include that we want to generate.
|
2019-02-06 11:51:00 +08:00
|
|
|
set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
|
|
|
|
|
|
|
|
set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
|
|
|
|
|
|
|
|
if(llvm_vc)
|
|
|
|
set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})
|
2019-01-31 15:12:43 +08:00
|
|
|
endif()
|
2019-02-06 11:51:00 +08:00
|
|
|
if(clang_vc)
|
|
|
|
set(clang_source_dir ${CLANG_SOURCE_DIR})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Create custom target to generate the VC revision include.
|
|
|
|
add_custom_command(OUTPUT "${version_inc}"
|
|
|
|
DEPENDS "${llvm_vc}" "${clang_vc}" "${generate_vcs_version_script}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} "-DNAMES=\"LLVM;CLANG\""
|
|
|
|
"-DLLVM_SOURCE_DIR=${llvm_source_dir}"
|
|
|
|
"-DCLANG_SOURCE_DIR=${clang_source_dir}"
|
|
|
|
"-DHEADER_FILE=${version_inc}"
|
|
|
|
-P "${generate_vcs_version_script}")
|
|
|
|
|
|
|
|
# Mark the generated header as being generated.
|
|
|
|
set_source_files_properties("${version_inc}"
|
|
|
|
PROPERTIES GENERATED TRUE
|
|
|
|
HEADER_FILE_ONLY TRUE)
|
|
|
|
|
|
|
|
set_property(SOURCE Version.cpp APPEND PROPERTY
|
|
|
|
COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC")
|
2014-11-20 06:03:48 +08:00
|
|
|
|
2008-10-26 08:56:18 +08:00
|
|
|
add_clang_library(clangBasic
|
2014-03-31 21:14:44 +08:00
|
|
|
Attributes.cpp
|
2009-06-14 09:05:48 +08:00
|
|
|
Builtins.cpp
|
2013-02-09 06:30:22 +08:00
|
|
|
CharInfo.cpp
|
2018-12-11 11:18:39 +08:00
|
|
|
CodeGenOptions.cpp
|
2016-07-07 05:21:39 +08:00
|
|
|
Cuda.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
Diagnostic.cpp
|
2010-11-19 05:19:52 +08:00
|
|
|
DiagnosticIDs.cpp
|
2015-06-13 15:11:40 +08:00
|
|
|
DiagnosticOptions.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
FileManager.cpp
|
2010-11-24 03:19:34 +08:00
|
|
|
FileSystemStatCache.cpp
|
2018-08-07 00:42:37 +08:00
|
|
|
FixedPoint.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
IdentifierTable.cpp
|
2011-09-14 01:21:33 +08:00
|
|
|
LangOptions.cpp
|
2011-12-01 07:21:26 +08:00
|
|
|
Module.cpp
|
2012-06-20 14:18:46 +08:00
|
|
|
ObjCRuntime.cpp
|
2013-03-22 14:34:35 +08:00
|
|
|
OpenMPKinds.cpp
|
2012-12-21 04:25:19 +08:00
|
|
|
OperatorPrecedence.cpp
|
2014-10-16 03:57:45 +08:00
|
|
|
SanitizerBlacklist.cpp
|
2017-09-26 06:11:12 +08:00
|
|
|
SanitizerSpecialCaseList.cpp
|
2014-11-11 09:26:14 +08:00
|
|
|
Sanitizers.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
SourceLocation.cpp
|
|
|
|
SourceManager.cpp
|
|
|
|
TargetInfo.cpp
|
|
|
|
Targets.cpp
|
2017-07-22 06:37:03 +08:00
|
|
|
Targets/AArch64.cpp
|
|
|
|
Targets/AMDGPU.cpp
|
2018-11-28 03:52:10 +08:00
|
|
|
Targets/ARC.cpp
|
2017-07-22 06:37:03 +08:00
|
|
|
Targets/ARM.cpp
|
|
|
|
Targets/AVR.cpp
|
|
|
|
Targets/BPF.cpp
|
|
|
|
Targets/Hexagon.cpp
|
|
|
|
Targets/Lanai.cpp
|
|
|
|
Targets/Le64.cpp
|
|
|
|
Targets/MSP430.cpp
|
|
|
|
Targets/Mips.cpp
|
|
|
|
Targets/NVPTX.cpp
|
|
|
|
Targets/OSTargets.cpp
|
|
|
|
Targets/PNaCl.cpp
|
|
|
|
Targets/PPC.cpp
|
2018-01-11 21:36:56 +08:00
|
|
|
Targets/RISCV.cpp
|
2017-07-22 06:37:03 +08:00
|
|
|
Targets/SPIR.cpp
|
|
|
|
Targets/Sparc.cpp
|
|
|
|
Targets/SystemZ.cpp
|
|
|
|
Targets/TCE.cpp
|
|
|
|
Targets/WebAssembly.cpp
|
|
|
|
Targets/X86.cpp
|
|
|
|
Targets/XCore.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
TokenKinds.cpp
|
2009-10-06 04:33:49 +08:00
|
|
|
Version.cpp
|
2014-04-30 00:25:26 +08:00
|
|
|
Warnings.cpp
|
2018-04-13 10:31:58 +08:00
|
|
|
XRayInstr.cpp
|
2017-03-30 08:29:36 +08:00
|
|
|
XRayLists.cpp
|
2014-11-20 06:03:48 +08:00
|
|
|
${version_inc}
|
2008-10-26 08:56:18 +08:00
|
|
|
)
|
2009-03-17 07:06:59 +08:00
|
|
|
|