2 if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
3 set(system_libs ${system_libs} ${ZLIB_LIBRARIES})
6 # libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
7 # advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.
8 set(system_libs ${system_libs} psapi shell32 ole32 uuid advapi32)
9 elseif( CMAKE_HOST_UNIX )
11 set(system_libs ${system_libs} rt)
14 set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
16 if( HAVE_BACKTRACE AND NOT "${Backtrace_LIBRARIES}" STREQUAL "" )
17 # On BSDs, CMake returns a fully qualified path to the backtrace library.
18 # We need to remove the path and the 'lib' prefix, to make it look like a
19 # regular short library name, suitable for appending to a -l link flag.
20 get_filename_component(Backtrace_LIBFILE ${Backtrace_LIBRARIES} NAME_WE)
21 STRING(REGEX REPLACE "^lib" "" Backtrace_LIBFILE ${Backtrace_LIBFILE})
22 set(system_libs ${system_libs} ${Backtrace_LIBFILE})
24 if(LLVM_ENABLE_TERMINFO)
26 set(system_libs ${system_libs} ${TERMINFO_LIBS})
29 if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
30 set(system_libs ${system_libs} atomic)
32 set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB})
33 if( UNIX AND NOT (BEOS OR HAIKU) )
34 set(system_libs ${system_libs} m)
37 set(system_libs ${system_libs} zircon)
39 endif( MSVC OR MINGW )
41 # Delay load shell32.dll if possible to speed up process startup.
44 set (delayload_flags delayimp -delayload:shell32.dll -delayload:ole32.dll)
47 # Link Z3 if the user wants to build it.
49 set(Z3_LINK_FILES ${Z3_LIBRARIES})
54 add_llvm_library(LLVMSupport
55 AArch64TargetParser.cpp
62 ARMAttributeParser.cpp
66 BinaryStreamReader.cpp
68 BinaryStreamWriter.cpp
73 circular_raw_ostream.cpp
82 CrashRecoveryContext.cpp
103 ItaniumManglingCanonicalizer.cpp
122 RandomNumberGenerator.cpp
138 SymbolRemappingReader.cpp
152 VirtualFileSystem.cpp
184 ADDITIONAL_HEADER_DIRS
187 ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT
188 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support
189 ${Backtrace_INCLUDE_DIRS}
190 LINK_LIBS ${system_libs} ${delayload_flags} ${Z3_LINK_FILES}
193 set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")
196 target_include_directories(LLVMSupport SYSTEM