[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / lld / Common / CMakeLists.txt
blob1ae7da1f5f7f075bd92962d4d7a4afe806f7ed00
1 set(LLD_SYSTEM_LIBS ${LLVM_PTHREAD_LIB})
3 if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
4   list(APPEND LLD_SYSTEM_LIBS atomic)
5 endif()
7 find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
8 find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc)
10 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
11 set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
13 if(lld_vc AND LLVM_APPEND_VC_REV)
14   set(lld_source_dir ${LLD_SOURCE_DIR})
15 endif()
17 add_custom_command(OUTPUT "${version_inc}"
18   DEPENDS "${lld_vc}" "${generate_vcs_version_script}"
19   COMMAND ${CMAKE_COMMAND} "-DNAMES=LLD"
20   "-DLLD_SOURCE_DIR=${lld_source_dir}"
21   "-DHEADER_FILE=${version_inc}"
22   -P "${generate_vcs_version_script}")
24 # Mark the generated header as being generated.
25 set_source_files_properties("${version_inc}"
26   PROPERTIES GENERATED TRUE
27   HEADER_FILE_ONLY TRUE)
29 add_lld_library(lldCommon
30   Args.cpp
31   CommonLinkerContext.cpp
32   DWARF.cpp
33   ErrorHandler.cpp
34   Filesystem.cpp
35   Memory.cpp
36   Reproduce.cpp
37   Strings.cpp
38   TargetOptionsCommandFlags.cpp
39   Timer.cpp
40   VCSVersion.inc
41   Version.cpp
43   ADDITIONAL_HEADER_DIRS
44   ${LLD_INCLUDE_DIR}/lld/Common
46   LINK_COMPONENTS
47   Codegen
48   Core
49   DebugInfoDWARF
50   Demangle
51   MC
52   Option
53   Support
54   Target
56   LINK_LIBS
57   ${LLD_SYSTEM_LIBS}
59   DEPENDS
60   intrinsics_gen
61   )