1if (APPLE AND LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY) 2 # The arpa/inet.h header used in the files here is providing a miscompiled 3 # htonl function on macOS <= 10.15 when local submodule visibility is active. 4 # Disabling modules in this directory until this is is fixed. 5 # See rdar://problem/62886385 6 remove_module_flags() 7endif() 8 9macro(add_host_subdirectory group) 10 list(APPEND HOST_SOURCES ${ARGN}) 11 source_group(${group} FILES ${ARGN}) 12endmacro() 13 14add_host_subdirectory(common 15 common/FileAction.cpp 16 common/FileCache.cpp 17 common/File.cpp 18 common/FileSystem.cpp 19 common/GetOptInc.cpp 20 common/Host.cpp 21 common/HostInfoBase.cpp 22 common/HostNativeThreadBase.cpp 23 common/HostProcess.cpp 24 common/HostThread.cpp 25 common/LockFileBase.cpp 26 common/LZMA.cpp 27 common/MainLoop.cpp 28 common/MonitoringProcessLauncher.cpp 29 common/NativeProcessProtocol.cpp 30 common/NativeRegisterContext.cpp 31 common/NativeThreadProtocol.cpp 32 common/NativeWatchpointList.cpp 33 common/OptionParser.cpp 34 common/PipeBase.cpp 35 common/ProcessLaunchInfo.cpp 36 common/ProcessRunLock.cpp 37 common/PseudoTerminal.cpp 38 common/SocketAddress.cpp 39 common/Socket.cpp 40 common/StringConvert.cpp 41 common/TCPSocket.cpp 42 common/Terminal.cpp 43 common/ThreadLauncher.cpp 44 common/UDPSocket.cpp 45 common/XML.cpp 46 ) 47 48if (LLDB_ENABLE_LIBEDIT) 49 add_host_subdirectory(common 50 common/Editline.cpp 51 ) 52endif() 53 54add_host_subdirectory(posix 55 posix/ConnectionFileDescriptorPosix.cpp 56 ) 57 58if (CMAKE_SYSTEM_NAME MATCHES "Windows") 59 add_host_subdirectory(windows 60 windows/ConnectionGenericFileWindows.cpp 61 windows/EditLineWin.cpp 62 windows/FileSystem.cpp 63 windows/Host.cpp 64 windows/HostInfoWindows.cpp 65 windows/HostProcessWindows.cpp 66 windows/HostThreadWindows.cpp 67 windows/LockFileWindows.cpp 68 windows/PipeWindows.cpp 69 windows/ProcessLauncherWindows.cpp 70 windows/ProcessRunLock.cpp 71 windows/Windows.cpp 72 ) 73else() 74 add_host_subdirectory(posix 75 posix/DomainSocket.cpp 76 posix/FileSystemPosix.cpp 77 posix/HostInfoPosix.cpp 78 posix/HostProcessPosix.cpp 79 posix/HostThreadPosix.cpp 80 posix/LockFilePosix.cpp 81 posix/PipePosix.cpp 82 posix/ProcessLauncherPosixFork.cpp 83 ) 84 85 if (CMAKE_SYSTEM_NAME MATCHES "Darwin") 86 add_subdirectory(macosx/objcxx) 87 set(LLDBObjCLibs lldbHostMacOSXObjCXX) 88 add_host_subdirectory(macosx 89 macosx/cfcpp/CFCBundle.cpp 90 macosx/cfcpp/CFCData.cpp 91 macosx/cfcpp/CFCMutableArray.cpp 92 macosx/cfcpp/CFCMutableDictionary.cpp 93 macosx/cfcpp/CFCMutableSet.cpp 94 macosx/cfcpp/CFCString.cpp 95 ) 96 if(APPLE_EMBEDDED) 97 set_property(SOURCE macosx/Host.mm APPEND PROPERTY 98 COMPILE_DEFINITIONS "NO_XPC_SERVICES=1") 99 endif() 100 101 102 elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android") 103 add_host_subdirectory(linux 104 linux/AbstractSocket.cpp 105 linux/Host.cpp 106 linux/HostInfoLinux.cpp 107 linux/LibcGlue.cpp 108 linux/Support.cpp 109 ) 110 if (CMAKE_SYSTEM_NAME MATCHES "Android") 111 add_host_subdirectory(android 112 android/HostInfoAndroid.cpp 113 android/LibcGlue.cpp 114 ) 115 endif() 116 elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") 117 add_host_subdirectory(freebsd 118 freebsd/Host.cpp 119 freebsd/HostInfoFreeBSD.cpp 120 ) 121 122 elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") 123 add_host_subdirectory(netbsd 124 netbsd/HostNetBSD.cpp 125 netbsd/HostInfoNetBSD.cpp 126 ) 127 128 elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") 129 add_host_subdirectory(openbsd 130 openbsd/Host.cpp 131 openbsd/HostInfoOpenBSD.cpp 132 ) 133 endif() 134endif() 135 136set(EXTRA_LIBS) 137if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") 138 list(APPEND EXTRA_LIBS kvm) 139endif() 140if (LLDB_ENABLE_LIBXML2) 141 list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) 142endif() 143if (HAVE_LIBDL) 144 list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) 145endif() 146if (LLDB_ENABLE_LIBEDIT) 147 list(APPEND EXTRA_LIBS ${LibEdit_LIBRARIES}) 148endif() 149if (LLDB_ENABLE_LZMA) 150 list(APPEND EXTRA_LIBS ${LIBLZMA_LIBRARIES}) 151endif() 152if (WIN32) 153 list(APPEND LLDB_SYSTEM_LIBS psapi) 154endif() 155 156if (LLDB_ENABLE_LIBEDIT) 157 list(APPEND LLDB_LIBEDIT_LIBS ${LibEdit_LIBRARIES}) 158 if (LLVM_BUILD_STATIC) 159 list(APPEND LLDB_SYSTEM_LIBS gpm) 160 endif() 161endif() 162 163add_lldb_library(lldbHost 164 ${HOST_SOURCES} 165 166 LINK_LIBS 167 lldbUtility 168 ${EXTRA_LIBS} 169 ${LLDBObjCLibs} 170 ${LLDB_LIBEDIT_LIBS} 171 172 LINK_COMPONENTS 173 Object 174 Support 175 ) 176 177if (LLDB_ENABLE_LIBEDIT) 178 target_include_directories(lldbHost PUBLIC ${LibEdit_INCLUDE_DIRS}) 179endif() 180