comparison lld/Common/CMakeLists.txt @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 0572611fdcc8
comparison
equal deleted inserted replaced
147:c2174574ed3a 150:1d019706d866
1 if(NOT LLD_BUILT_STANDALONE)
2 set(tablegen_deps intrinsics_gen)
3 endif()
4
5 find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
6 find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc)
7
8 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
9 set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
10
11 if(lld_vc AND LLVM_APPEND_VC_REV)
12 set(lld_source_dir ${LLD_SOURCE_DIR})
13 endif()
14
15 add_custom_command(OUTPUT "${version_inc}"
16 DEPENDS "${lld_vc}" "${generate_vcs_version_script}"
17 COMMAND ${CMAKE_COMMAND} "-DNAMES=LLD"
18 "-DLLD_SOURCE_DIR=${lld_source_dir}"
19 "-DHEADER_FILE=${version_inc}"
20 -P "${generate_vcs_version_script}")
21
22 # Mark the generated header as being generated.
23 set_source_files_properties("${version_inc}"
24 PROPERTIES GENERATED TRUE
25 HEADER_FILE_ONLY TRUE)
26
27 set_property(SOURCE Version.cpp APPEND PROPERTY
28 COMPILE_DEFINITIONS "HAVE_VCS_VERSION_INC")
29
30 add_lld_library(lldCommon
31 Args.cpp
32 DWARF.cpp
33 ErrorHandler.cpp
34 Filesystem.cpp
35 Memory.cpp
36 Reproduce.cpp
37 Strings.cpp
38 TargetOptionsCommandFlags.cpp
39 Threads.cpp
40 Timer.cpp
41 VCSVersion.inc
42 Version.cpp
43
44 ADDITIONAL_HEADER_DIRS
45 ${LLD_INCLUDE_DIR}/lld/Common
46
47 LINK_COMPONENTS
48 Codegen
49 Core
50 DebugInfoDWARF
51 Demangle
52 MC
53 Option
54 Support
55 Target
56
57 LINK_LIBS
58 ${LLVM_PTHREAD_LIB}
59
60 DEPENDS
61 ${tablegen_deps}
62 )