Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / Common / CMakeLists.txt
blob4f503d04f7844f7576c05023ca79e8847617d63d
1 find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
2 find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc)
4 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
5 set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
7 if(lld_vc AND LLVM_APPEND_VC_REV)
8   set(lld_source_dir ${LLD_SOURCE_DIR})
9 endif()
11 add_custom_command(OUTPUT "${version_inc}"
12   DEPENDS "${lld_vc}" "${generate_vcs_version_script}"
13   COMMAND ${CMAKE_COMMAND} "-DNAMES=LLD"
14   "-DLLD_SOURCE_DIR=${lld_source_dir}"
15   "-DHEADER_FILE=${version_inc}"
16   "-DLLVM_FORCE_VC_REVISION=${LLVM_FORCE_VC_REVISION}"
17   "-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}"
18   -P "${generate_vcs_version_script}")
20 # Mark the generated header as being generated.
21 set_source_files_properties("${version_inc}"
22   PROPERTIES GENERATED TRUE
23   HEADER_FILE_ONLY TRUE)
25 add_lld_library(lldCommon
26   Args.cpp
27   CommonLinkerContext.cpp
28   DriverDispatcher.cpp
29   DWARF.cpp
30   ErrorHandler.cpp
31   Filesystem.cpp
32   Memory.cpp
33   Reproduce.cpp
34   Strings.cpp
35   TargetOptionsCommandFlags.cpp
36   Timer.cpp
37   VCSVersion.inc
38   Version.cpp
40   ADDITIONAL_HEADER_DIRS
41   ${LLD_INCLUDE_DIR}/lld/Common
43   LINK_COMPONENTS
44   Codegen
45   Core
46   DebugInfoDWARF
47   Demangle
48   MC
49   Option
50   Support
51   Target
52   TargetParser
54   LINK_LIBS
55   ${LLVM_PTHREAD_LIB}
56   ${LLVM_ATOMIC_LIB}
58   DEPENDS
59   intrinsics_gen
60   )