Debian Codegraph @

Source/Core/Common/CMakeLists.txt

raw
1 add_library(common
2 Analytics.cpp
3 Analytics.h
4 Assembler/AssemblerShared.cpp
5 Assembler/AssemblerShared.h
6 Assembler/AssemblerTables.cpp
7 Assembler/AssemblerTables.h
8 Assembler/GekkoAssembler.cpp
9 Assembler/GekkoAssembler.h
10 Assembler/GekkoIRGen.cpp
11 Assembler/GekkoIRGen.h
12 Assembler/GekkoLexer.cpp
13 Assembler/GekkoLexer.h
14 Assembler/GekkoParser.cpp
15 Assembler/GekkoParser.h
16 Assert.h
17 BitField.h
18 BitSet.h
19 BitUtils.h
20 BlockingLoop.h
21 Buffer.h
22 ChunkFile.h
23 CodeBlock.h
24 ColorUtil.cpp
25 ColorUtil.h
26 Common.h
27 CommonFuncs.cpp
28 CommonFuncs.h
29 CommonPaths.h
30 CommonTypes.h
31 Config/Config.cpp
32 Config/Config.h
33 Config/ConfigInfo.cpp
34 Config/ConfigInfo.h
35 Config/Enums.h
36 Config/Layer.cpp
37 Config/Layer.h
38 Contains.h
39 CPUDetect.h
40 Crypto/AES.cpp
41 Crypto/AES.h
42 Crypto/bn.cpp
43 Crypto/bn.h
44 Crypto/ec.cpp
45 Crypto/ec.h
46 Crypto/HMAC.cpp
47 Crypto/HMAC.h
48 Crypto/SHA1.cpp
49 Crypto/SHA1.h
50 Debug/MemoryPatches.cpp
51 Debug/MemoryPatches.h
52 Debug/Threads.h
53 Debug/Watches.cpp
54 Debug/Watches.h
55 DirectIOFile.cpp
56 DirectIOFile.h
57 DynamicLibrary.cpp
58 DynamicLibrary.h
59 ENet.cpp
60 ENet.h
61 EnumFormatter.h
62 EnumMap.h
63 Event.h
64 FatFsUtil.cpp
65 FatFsUtil.h
66 FileSearch.cpp
67 FileSearch.h
68 FilesystemWatcher.cpp
69 FilesystemWatcher.h
70 FileUtil.cpp
71 FileUtil.h
72 FixedSizeQueue.h
73 Flag.h
74 FloatUtils.cpp
75 FloatUtils.h
76 Functional.h
77 FormatUtil.h
78 FPURoundMode.h
79 GekkoDisassembler.cpp
80 GekkoDisassembler.h
81 Hash.cpp
82 Hash.h
83 HookableEvent.h
84 HostDisassembler.cpp
85 HostDisassembler.h
86 HttpRequest.cpp
87 HttpRequest.h
88 Image.cpp
89 Image.h
90 IniFile.cpp
91 IniFile.h
92 Inline.h
93 IOFile.cpp
94 IOFile.h
95 JitRegister.cpp
96 JitRegister.h
97 JsonUtil.h
98 JsonUtil.cpp
99 Lazy.h
100 LinearDiskCache.h
101 UnixUtil.h
102 Logging/ConsoleListener.h
103 Logging/Log.h
104 Logging/LogManager.cpp
105 Logging/LogManager.h
106 MathUtil.h
107 Matrix.cpp
108 Matrix.h
109 MemArena.h
110 MemoryUtil.cpp
111 MemoryUtil.h
112 MinizipUtil.h
113 MsgHandler.cpp
114 MsgHandler.h
115 Mutex.h
116 NandPaths.cpp
117 NandPaths.h
118 Network.cpp
119 Network.h
120 OneShotEvent.h
121 PcapFile.cpp
122 PcapFile.h
123 Profiler.cpp
124 Profiler.h
125 Projection.h
126 QoSSession.cpp
127 QoSSession.h
128 Random.cpp
129 Random.h
130 RangeSet.h
131 RangeSizeSet.h
132 ScopeGuard.h
133 SDCardUtil.cpp
134 SDCardUtil.h
135 Semaphore.h
136 SettingsHandler.cpp
137 SettingsHandler.h
138 SFMLHelper.cpp
139 SFMLHelper.h
140 SmallVector.h
141 SocketContext.cpp
142 SocketContext.h
143 SpanUtils.h
144 SPSCQueue.h
145 StringLiteral.h
146 StringUtil.cpp
147 StringUtil.h
148 SymbolDB.cpp
149 SymbolDB.h
150 Thread.cpp
151 Thread.h
152 Timer.cpp
153 Timer.h
154 TimeUtil.cpp
155 TimeUtil.h
156 TransferableSharedMutex.h
157 TraversalClient.cpp
158 TraversalClient.h
159 TraversalProto.h
160 TypeUtils.h
161 UPnP.cpp
162 UPnP.h
163 VariantUtil.h
164 Version.cpp
165 Version.h
166 WaitableFlag.h
167 WindowSystemInfo.h
168 WorkQueueThread.h
169 )
170
171 add_dependencies(common dolphin_scmrev)
172
173 if(NOT MSVC AND _M_ARM_64)
174 set_source_files_properties(
175 Crypto/AES.cpp
176 Crypto/SHA1.cpp
177 PROPERTIES COMPILE_FLAGS "-march=armv8-a+crypto")
178 endif()
179
180 target_link_libraries(common
181 PUBLIC
182 ${CMAKE_THREAD_LIBS_INIT}
183 enet::enet
184 fmt::fmt
185 MbedTLS::mbedtls
186 MINIZIP::minizip-ng
187 sfml-network
188
189 PRIVATE
190 CURL::libcurl
191 FatFs
192 spng::spng
193 watcher
194 ${VTUNE_LIBRARIES}
195 )
196
197 if ((DEFINED CMAKE_ANDROID_ARCH_ABI AND CMAKE_ANDROID_ARCH_ABI MATCHES "x86|x86_64") OR
198 (NOT DEFINED CMAKE_ANDROID_ARCH_ABI AND _M_X86_64))
199 target_link_libraries(common PRIVATE bdisasm)
200 endif()
201
202 if (APPLE)
203 target_link_libraries(common
204 PRIVATE
205 ${APPKIT_LIBRARY}
206 ${COREFOUNDATION_LIBRARY}
207 ${FOUNDATION_LIBRARY}
208 ${IOK_LIBRARY}
209 )
210 elseif(WIN32)
211 target_link_libraries(common
212 PRIVATE
213 kernel32.lib
214 shlwapi.lib
215 winmm.lib
216 )
217 if (_M_X86_64)
218 target_link_libraries(common PRIVATE opengl32.lib)
219 endif()
220 elseif (ANDROID)
221 target_link_libraries(common
222 PRIVATE
223 androidcommon
224 )
225 elseif(HAIKU)
226 target_link_libraries(common PRIVATE be GL)
227 endif()
228
229 if(ANDROID)
230 target_sources(common PRIVATE
231 Logging/ConsoleListenerDroid.cpp
232 MemArenaAndroid.cpp
233 )
234 elseif(WIN32)
235 target_sources(common PRIVATE
236 LdrWatcher.cpp
237 LdrWatcher.h
238 Logging/ConsoleListenerWin.cpp
239 MemArenaWin.cpp
240 )
241 elseif(APPLE)
242 target_sources(common PRIVATE
243 CommonFuncsObjC.mm
244 Logging/ConsoleListenerNix.cpp
245 MemArenaDarwin.cpp
246 )
247 else()
248 target_sources(common PRIVATE
249 Logging/ConsoleListenerNix.cpp
250 MemArenaUnix.cpp
251 )
252 endif()
253
254 if(_M_ARM_64)
255 target_sources(common PRIVATE
256 Arm64Emitter.cpp
257 Arm64Emitter.h
258 ArmCommon.h
259 ArmCPUDetect.cpp
260 ArmFPURoundMode.cpp
261 )
262 else()
263 if(_M_X86_64) #X86
264 target_sources(common PRIVATE
265 x64ABI.cpp
266 x64ABI.h
267 x64Emitter.cpp
268 x64Emitter.h
269 x64FPURoundMode.cpp
270 x64CPUDetect.cpp
271 x64Reg.h
272 )
273 else() # Generic
274 target_sources(common PRIVATE
275 GenericFPURoundMode.cpp
276 GenericCPUDetect.cpp
277 )
278 endif()
279 endif()
280
281 # OpenGL Interface
282 target_sources(common PRIVATE
283 GL/GLContext.cpp
284 GL/GLContext.h
285 GL/GLUtil.cpp
286 GL/GLUtil.h
287 GL/GLExtensions/GLExtensions.cpp
288 GL/GLExtensions/GLExtensions.h
289 )
290
291 if(ENABLE_EGL AND EGL_FOUND)
292 target_sources(common PRIVATE
293 GL/GLInterface/EGL.cpp
294 GL/GLInterface/EGL.h
295 )
296 if(ANDROID)
297 target_sources(common PRIVATE
298 GL/GLInterface/EGLAndroid.cpp
299 GL/GLInterface/EGLAndroid.h
300 )
301 elseif(ENABLE_X11 AND X11_FOUND)
302 target_sources(common PRIVATE
303 GL/GLInterface/EGLX11.cpp
304 GL/GLInterface/EGLX11.h
305 )
306 endif()
307 target_include_directories(common PRIVATE ${EGL_INCLUDE_DIRS})
308 target_link_libraries(common PUBLIC ${EGL_LIBRARIES})
309 endif()
310
311 if(WIN32)
312 target_sources(common PRIVATE
313 CompatPatches.cpp
314 GL/GLInterface/WGL.cpp
315 GL/GLInterface/WGL.h
316 WindowsDevice.cpp
317 WindowsDevice.h
318 WindowsRegistry.cpp
319 )
320 elseif(APPLE)
321 target_sources(common PRIVATE
322 GL/GLInterface/AGL.h
323 GL/GLInterface/AGL.mm
324 )
325 elseif(HAIKU)
326 target_sources(common PRIVATE
327 GL/GLInterface/BGL.h
328 GL/GLInterface/BGL.cpp
329 )
330 elseif(ENABLE_X11 AND X11_FOUND)
331 target_sources(common PRIVATE
332 GL/GLX11Window.cpp
333 GL/GLX11Window.h
334 )
335 endif()
336
337 if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
338 target_link_libraries(common PUBLIC dl rt)
339 endif()
340
341 if(WIN32)
342 target_sources(common PRIVATE HRWrap.h HRWrap.cpp)
343 else()
344 target_link_libraries(common PRIVATE Iconv::Iconv)
345 endif()
346
347 if(USE_UPNP)
348 target_link_libraries(common PRIVATE Miniupnpc::miniupnpc)
349 endif()
350
351 if(ENABLE_LLVM)
352 find_package(LLVM CONFIG)
353 if(LLVM_FOUND)
354 message(STATUS "LLVM found, enabling LLVM support in disassembler")
355 target_compile_definitions(common PRIVATE HAVE_LLVM)
356 # Minimal documentation about LLVM's CMake functions is available here:
357 # https://releases.llvm.org/16.0.0/docs/CMake.html#embedding-llvm-in-your-project
358 # https://groups.google.com/g/llvm-dev/c/YeEVe7HTasQ?pli=1
359 #
360 # However, you have to read the source code in any case.
361 # Look for LLVM-Config.cmake in your (Unix) system:
362 # $ find /usr -name LLVM-Config\\.cmake 2>/dev/null
363 llvm_expand_pseudo_components(LLVM_EXPAND_COMPONENTS
364 AllTargetsInfos AllTargetsDisassemblers AllTargetsCodeGens
365 )
366 llvm_config(common USE_SHARED
367 mcdisassembler target ${LLVM_EXPAND_COMPONENTS}
368 )
369 target_include_directories(common PRIVATE ${LLVM_INCLUDE_DIRS})
370 endif()
371 endif()
372
373 if(UNIX)
374 # Posix networking code needs to be fixed for Windows
375 add_executable(traversal_server TraversalServer.cpp)
376 target_link_libraries(traversal_server PRIVATE common fmt::fmt)
377 if(SYSTEMD_FOUND)
378 target_link_libraries(traversal_server PRIVATE ${SYSTEMD_LIBRARIES})
379 endif()
380 elseif(WIN32)
381 find_package(PowerShell REQUIRED)
382 execute_process(
383 COMMAND ${POWERSHELL_EXE} -Command "[System.Diagnostics.FileVersionInfo]::GetVersionInfo('$ENV{VCToolsRedistDir}vc_redist.x64.exe').ProductVersion"
384 OUTPUT_VARIABLE VC_TOOLS_VERSION
385 OUTPUT_STRIP_TRAILING_WHITESPACE
386 )
387 configure_file(
388 "${CMAKE_CURRENT_SOURCE_DIR}/build_info.txt.in"
389 "${CMAKE_BINARY_DIR}/build_info.txt"
390 )
391
392 target_link_libraries(common PRIVATE "-INCLUDE:enableCompatPatches")
393 endif()
394
395 if(MSVC)
396 # Add precompiled header
397 target_link_libraries(common PRIVATE use_pch)
398 endif()