Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 1 | macro(add_host_subdirectory group) |
| 2 | list(APPEND HOST_SOURCES ${ARGN}) |
Zachary Turner | 3ffabc2 | 2014-08-18 16:47:33 +0000 | [diff] [blame] | 3 | source_group(${group} FILES ${ARGN}) |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 4 | endmacro() |
| 5 | |
Raphael Isemann | 2c77eef | 2018-06-13 15:50:45 +0000 | [diff] [blame] | 6 | # Removes all module flags from the current CMAKE_CXX_FLAGS. Used for |
| 7 | # the Objective-C++ code in lldb which we don't want to build with modules. |
| 8 | # Reasons for this are that modules with Objective-C++ would require that |
| 9 | # all LLVM/Clang modules are Objective-C++ compatible (which they are likely |
| 10 | # not) and we would have rebuild a second set of modules just for the few |
| 11 | # Objective-C++ files in lldb (which slows down the build process). |
| 12 | macro(remove_module_flags) |
| 13 | string(REGEX REPLACE "-fmodules-cache-path=[^ ]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
Adrian Prantl | e884ccb | 2018-11-09 00:49:18 +0000 | [diff] [blame] | 14 | string(REGEX REPLACE "-fmodules-local-submodule-visibility" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
Raphael Isemann | 2c77eef | 2018-06-13 15:50:45 +0000 | [diff] [blame] | 15 | string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
Adrian Prantl | e884ccb | 2018-11-09 00:49:18 +0000 | [diff] [blame] | 16 | string(REGEX REPLACE "-gmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
Raphael Isemann | 2c77eef | 2018-06-13 15:50:45 +0000 | [diff] [blame] | 17 | string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") |
| 18 | endmacro() |
| 19 | |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 20 | add_host_subdirectory(common |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 21 | common/File.cpp |
| 22 | common/FileCache.cpp |
Oleksiy Vyalov | 7a9e762 | 2015-02-20 18:34:03 +0000 | [diff] [blame] | 23 | common/FileSystem.cpp |
Pavel Labath | a04668f | 2015-09-04 09:06:15 +0000 | [diff] [blame] | 24 | common/GetOptInc.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 25 | common/Host.cpp |
Zachary Turner | 97a14e6 | 2014-08-19 17:18:29 +0000 | [diff] [blame] | 26 | common/HostInfoBase.cpp |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 27 | common/HostNativeThreadBase.cpp |
Zachary Turner | f5e4f37 | 2014-09-11 22:22:16 +0000 | [diff] [blame] | 28 | common/HostProcess.cpp |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 29 | common/HostThread.cpp |
Oleksiy Vyalov | 919ef9d | 2015-05-07 15:28:49 +0000 | [diff] [blame] | 30 | common/LockFileBase.cpp |
Chris Bieneman | 1182779 | 2017-04-26 23:17:20 +0000 | [diff] [blame] | 31 | common/MainLoop.cpp |
Zachary Turner | 172d37d | 2014-10-14 21:55:08 +0000 | [diff] [blame] | 32 | common/MonitoringProcessLauncher.cpp |
Chaoren Lin | 18fe640 | 2015-02-03 01:51:47 +0000 | [diff] [blame] | 33 | common/NativeWatchpointList.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 34 | common/NativeProcessProtocol.cpp |
Chaoren Lin | 2fe1d0a | 2015-02-03 01:51:38 +0000 | [diff] [blame] | 35 | common/NativeRegisterContext.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 36 | common/NativeThreadProtocol.cpp |
| 37 | common/OptionParser.cpp |
Oleksiy Vyalov | d5f8b6a | 2015-01-13 23:19:40 +0000 | [diff] [blame] | 38 | common/PipeBase.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 39 | common/ProcessRunLock.cpp |
Zachary Turner | 24ae629 | 2017-02-16 19:38:21 +0000 | [diff] [blame] | 40 | common/PseudoTerminal.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 41 | common/Socket.cpp |
| 42 | common/SocketAddress.cpp |
Vince Harron | 5275aaa | 2015-01-15 20:08:35 +0000 | [diff] [blame] | 43 | common/StringConvert.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 44 | common/Symbols.cpp |
Francis Ricci | 7ddfe8e | 2017-09-19 15:38:30 +0000 | [diff] [blame] | 45 | common/TaskPool.cpp |
Oleksiy Vyalov | e98628c | 2015-10-15 23:54:09 +0000 | [diff] [blame] | 46 | common/TCPSocket.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 47 | common/Terminal.cpp |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 48 | common/ThreadLauncher.cpp |
Greg Clayton | d04f0ed | 2015-05-26 18:00:51 +0000 | [diff] [blame] | 49 | common/XML.cpp |
Oleksiy Vyalov | e98628c | 2015-10-15 23:54:09 +0000 | [diff] [blame] | 50 | common/UDPSocket.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 51 | ) |
Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 52 | |
Zachary Turner | d553d00 | 2014-11-17 21:31:18 +0000 | [diff] [blame] | 53 | if (NOT LLDB_DISABLE_LIBEDIT) |
| 54 | add_host_subdirectory(common |
| 55 | common/Editline.cpp |
| 56 | ) |
Shawn Best | 8da0bf3 | 2014-11-08 01:41:49 +0000 | [diff] [blame] | 57 | endif() |
| 58 | |
Zachary Turner | 93a66fc | 2014-10-06 21:22:36 +0000 | [diff] [blame] | 59 | add_host_subdirectory(posix |
| 60 | posix/ConnectionFileDescriptorPosix.cpp |
| 61 | ) |
| 62 | |
Zachary Turner | c00cf4a | 2014-08-15 22:04:21 +0000 | [diff] [blame] | 63 | if (CMAKE_SYSTEM_NAME MATCHES "Windows") |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 64 | add_host_subdirectory(windows |
Zachary Turner | 12792af | 2014-10-06 21:23:09 +0000 | [diff] [blame] | 65 | windows/ConnectionGenericFileWindows.cpp |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 66 | windows/EditLineWin.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 67 | windows/FileSystem.cpp |
| 68 | windows/Host.cpp |
Zachary Turner | 97a14e6 | 2014-08-19 17:18:29 +0000 | [diff] [blame] | 69 | windows/HostInfoWindows.cpp |
Zachary Turner | 4e82ec9 | 2014-08-27 20:15:30 +0000 | [diff] [blame] | 70 | windows/HostProcessWindows.cpp |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 71 | windows/HostThreadWindows.cpp |
Oleksiy Vyalov | 919ef9d | 2015-05-07 15:28:49 +0000 | [diff] [blame] | 72 | windows/LockFileWindows.cpp |
Zachary Turner | b2df30d | 2014-10-08 20:38:41 +0000 | [diff] [blame] | 73 | windows/PipeWindows.cpp |
Zachary Turner | 172d37d | 2014-10-14 21:55:08 +0000 | [diff] [blame] | 74 | windows/ProcessLauncherWindows.cpp |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 75 | windows/ProcessRunLock.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 76 | windows/Windows.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 77 | ) |
Zachary Turner | c00cf4a | 2014-08-15 22:04:21 +0000 | [diff] [blame] | 78 | else() |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 79 | add_host_subdirectory(posix |
Oleksiy Vyalov | e98628c | 2015-10-15 23:54:09 +0000 | [diff] [blame] | 80 | posix/DomainSocket.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 81 | posix/FileSystem.cpp |
Zachary Turner | 97a14e6 | 2014-08-19 17:18:29 +0000 | [diff] [blame] | 82 | posix/HostInfoPosix.cpp |
Zachary Turner | 4e82ec9 | 2014-08-27 20:15:30 +0000 | [diff] [blame] | 83 | posix/HostProcessPosix.cpp |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 84 | posix/HostThreadPosix.cpp |
Oleksiy Vyalov | 919ef9d | 2015-05-07 15:28:49 +0000 | [diff] [blame] | 85 | posix/LockFilePosix.cpp |
Zachary Turner | b2df30d | 2014-10-08 20:38:41 +0000 | [diff] [blame] | 86 | posix/PipePosix.cpp |
Kamil Rytarowski | 816ae4b | 2017-02-01 14:30:40 +0000 | [diff] [blame] | 87 | posix/ProcessLauncherPosixFork.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 88 | ) |
Zachary Turner | c00cf4a | 2014-08-15 22:04:21 +0000 | [diff] [blame] | 89 | |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 90 | if (CMAKE_SYSTEM_NAME MATCHES "Darwin") |
| 91 | include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR}) |
Raphael Isemann | 2c77eef | 2018-06-13 15:50:45 +0000 | [diff] [blame] | 92 | add_subdirectory(macosx/objcxx) |
| 93 | set(LLDBObjCLibs lldbHostMacOSXObjCXX) |
Stefan Granitz | 73ee35e | 2018-11-12 16:22:24 +0000 | [diff] [blame] | 94 | add_host_subdirectory(macosx |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 95 | macosx/Symbols.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 96 | macosx/cfcpp/CFCBundle.cpp |
| 97 | macosx/cfcpp/CFCData.cpp |
| 98 | macosx/cfcpp/CFCMutableArray.cpp |
| 99 | macosx/cfcpp/CFCMutableDictionary.cpp |
| 100 | macosx/cfcpp/CFCMutableSet.cpp |
| 101 | macosx/cfcpp/CFCString.cpp |
| 102 | ) |
Chris Bieneman | f6b8ac2 | 2017-07-18 21:15:53 +0000 | [diff] [blame] | 103 | if(IOS) |
| 104 | set_property(SOURCE macosx/Host.mm APPEND PROPERTY |
| 105 | COMPILE_DEFINITIONS "NO_XPC_SERVICES=1") |
| 106 | endif() |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 107 | |
Chris Bieneman | 494f277 | 2017-01-31 20:43:05 +0000 | [diff] [blame] | 108 | |
Pavel Labath | e5cfc67 | 2017-01-17 11:55:00 +0000 | [diff] [blame] | 109 | elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android") |
Pavel Labath | 5ad891f | 2016-07-21 14:54:03 +0000 | [diff] [blame] | 110 | add_host_subdirectory(linux |
| 111 | linux/AbstractSocket.cpp |
| 112 | linux/Host.cpp |
| 113 | linux/HostInfoLinux.cpp |
Pavel Labath | 5ad891f | 2016-07-21 14:54:03 +0000 | [diff] [blame] | 114 | linux/LibcGlue.cpp |
Pavel Labath | 7e437f8 | 2017-03-15 15:08:49 +0000 | [diff] [blame] | 115 | linux/Support.cpp |
Pavel Labath | 5ad891f | 2016-07-21 14:54:03 +0000 | [diff] [blame] | 116 | ) |
Pavel Labath | e5cfc67 | 2017-01-17 11:55:00 +0000 | [diff] [blame] | 117 | if (CMAKE_SYSTEM_NAME MATCHES "Android") |
| 118 | add_host_subdirectory(android |
| 119 | android/HostInfoAndroid.cpp |
| 120 | android/LibcGlue.cpp |
| 121 | ) |
| 122 | endif() |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 123 | elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") |
| 124 | add_host_subdirectory(freebsd |
| 125 | freebsd/Host.cpp |
Zachary Turner | 97a14e6 | 2014-08-19 17:18:29 +0000 | [diff] [blame] | 126 | freebsd/HostInfoFreeBSD.cpp |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 127 | ) |
Bruce Mitchener | 64f74da | 2015-10-24 00:27:04 +0000 | [diff] [blame] | 128 | |
| 129 | elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") |
| 130 | add_host_subdirectory(netbsd |
| 131 | netbsd/Host.cpp |
| 132 | netbsd/HostInfoNetBSD.cpp |
Bruce Mitchener | 64f74da | 2015-10-24 00:27:04 +0000 | [diff] [blame] | 133 | ) |
Kamil Rytarowski | 12801f1 | 2017-03-26 15:34:57 +0000 | [diff] [blame] | 134 | |
| 135 | elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") |
| 136 | add_host_subdirectory(openbsd |
| 137 | openbsd/Host.cpp |
| 138 | openbsd/HostInfoOpenBSD.cpp |
| 139 | ) |
Zachary Turner | c00cf4a | 2014-08-15 22:04:21 +0000 | [diff] [blame] | 140 | endif() |
Joerg Sonnenberger | 340a175 | 2013-09-25 10:37:32 +0000 | [diff] [blame] | 141 | endif() |
Zachary Turner | 4ec5d0d | 2014-08-15 23:50:36 +0000 | [diff] [blame] | 142 | |
Michal Gorny | 7e1c51e | 2017-08-21 17:41:33 +0000 | [diff] [blame] | 143 | set(EXTRA_LIBS) |
Chris Bieneman | 987401b | 2017-01-31 20:52:41 +0000 | [diff] [blame] | 144 | if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") |
Michal Gorny | 7e1c51e | 2017-08-21 17:41:33 +0000 | [diff] [blame] | 145 | list(APPEND EXTRA_LIBS kvm) |
Chris Bieneman | 987401b | 2017-01-31 20:52:41 +0000 | [diff] [blame] | 146 | endif () |
Michal Gorny | 7e1c51e | 2017-08-21 17:41:33 +0000 | [diff] [blame] | 147 | if (APPLE) |
| 148 | list(APPEND EXTRA_LIBS xml2) |
| 149 | else () |
| 150 | if (LIBXML2_FOUND) |
| 151 | list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES}) |
| 152 | endif() |
| 153 | endif () |
| 154 | if (HAVE_LIBDL) |
| 155 | list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) |
| 156 | endif() |
| 157 | if (NOT LLDB_DISABLE_LIBEDIT) |
Tatyana Krasnukha | 3f166e4 | 2018-11-27 19:41:30 +0000 | [diff] [blame] | 158 | list(APPEND EXTRA_LIBS ${libedit_LIBRARIES}) |
Michal Gorny | 7e1c51e | 2017-08-21 17:41:33 +0000 | [diff] [blame] | 159 | endif() |
Chris Bieneman | 987401b | 2017-01-31 20:52:41 +0000 | [diff] [blame] | 160 | |
Chris Bieneman | 494f277 | 2017-01-31 20:43:05 +0000 | [diff] [blame] | 161 | add_lldb_library(lldbHost |
| 162 | ${HOST_SOURCES} |
Raphael Isemann | 2c77eef | 2018-06-13 15:50:45 +0000 | [diff] [blame] | 163 | |
Chris Bieneman | 494f277 | 2017-01-31 20:43:05 +0000 | [diff] [blame] | 164 | LINK_LIBS |
| 165 | lldbCore |
Chris Bieneman | 494f277 | 2017-01-31 20:43:05 +0000 | [diff] [blame] | 166 | lldbSymbol |
| 167 | lldbTarget |
| 168 | lldbUtility |
Chris Bieneman | 987401b | 2017-01-31 20:52:41 +0000 | [diff] [blame] | 169 | ${EXTRA_LIBS} |
Raphael Isemann | 2c77eef | 2018-06-13 15:50:45 +0000 | [diff] [blame] | 170 | ${LLDBObjCLibs} |
| 171 | |
Chris Bieneman | 494f277 | 2017-01-31 20:43:05 +0000 | [diff] [blame] | 172 | LINK_COMPONENTS |
Pavel Labath | 36e8220 | 2018-01-29 10:46:00 +0000 | [diff] [blame] | 173 | Object |
Chris Bieneman | 494f277 | 2017-01-31 20:43:05 +0000 | [diff] [blame] | 174 | Support |
| 175 | ) |
Tatyana Krasnukha | c4bc88b | 2018-09-21 18:34:41 +0000 | [diff] [blame] | 176 | |
| 177 | if (NOT LLDB_DISABLE_LIBEDIT) |
| 178 | target_include_directories(lldbHost PUBLIC ${libedit_INCLUDE_DIRS}) |
| 179 | endif() |