Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/CMakeLists.txt
5722 views
1
# vim:noexpandtab:
2
cmake_minimum_required(VERSION 3.16)
3
project(PPSSPP)
4
enable_testing()
5
6
#This is supposed to work but doesn't!
7
if(NOT ANDROID)
8
set(CMAKE_CXX_STANDARD 17)
9
set(CMAKE_CXX_STANDARD_REQUIRED ON)
10
endif()
11
12
enable_language(ASM)
13
14
add_compile_definitions(__STDC_CONSTANT_MACROS)
15
16
# Include AppleClang and Clang.
17
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
18
set(CLANG ON)
19
message("Clang enabled")
20
else()
21
message("Non-Clang compiler detected: ${CMAKE_CXX_COMPILER_ID}")
22
endif()
23
24
if(FORCED_CPU)
25
message("Detected CPU (${CMAKE_SYSTEM_PROCESSOR}) overridden as: ${FORCED_CPU}")
26
set(CMAKE_SYSTEM_PROCESSOR ${FORCED_CPU})
27
endif()
28
29
# Detect CPU from CMAKE configuration. Toolchains should set this up
30
if(CMAKE_SYSTEM_PROCESSOR)
31
if(CMAKE_OSX_ARCHITECTURES)
32
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES ".*86.*")
33
set(X86_DEVICE ON)
34
set(X86_64_DEVICE ON)
35
endif()
36
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64")
37
set(ARM64 ON)
38
endif()
39
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
40
set(ARM64 ON)
41
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm64")
42
# M1 Mac
43
set(ARM64 ON)
44
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
45
message("ARM_DEVICE is a go")
46
set(ARM_DEVICE ON)
47
if(UNIX AND NOT APPLE)
48
execute_process(COMMAND cat /proc/cpuinfo OUTPUT_VARIABLE OUTSTR)
49
string(FIND "${OUTSTR}" "ODROID-XU" pos)
50
if(NOT (pos LESS 0))
51
if(NOT WEBOS)
52
add_compile_options(-mfloat-abi=hard -marm -mtune=cortex-a15.cortex-a7 -mcpu=cortex-a15 -fomit-frame-pointer)
53
endif()
54
set(ARM_NO_VULKAN ON)
55
endif()
56
endif()
57
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7")
58
set(ARMV7_DEVICE ON)
59
add_compile_options(-mfpu=neon)
60
# Horrifying workaround for bug in android cmake stuff for asm files
61
if(ANDROID)
62
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -target armv7a-none-linux-android")
63
endif()
64
endif()
65
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^AMD64")
66
set(X86_DEVICE ON)
67
set(X86_64_DEVICE ON)
68
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
69
set(X86_DEVICE ON)
70
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^mips")
71
set(MIPS_DEVICE ON)
72
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^riscv64")
73
set(RISCV64_DEVICE ON)
74
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^loongarch64")
75
set(LOONGARCH64_DEVICE ON)
76
add_compile_options(-mlsx)
77
else()
78
message("Unknown CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
79
endif()
80
endif()
81
82
# the libraries in the ffmpeg/ directory are not compatible with mingw
83
if(MINGW AND NOT USE_SYSTEM_FFMPEG)
84
set(USE_SYSTEM_FFMPEG ON)
85
endif()
86
87
if(NOT ANDROID AND NOT IOS)
88
if(ARM_DEVICE OR SIMULATOR)
89
set(USING_EGL ON)
90
endif()
91
endif()
92
93
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT USE_LIBNX)
94
set(LINUX ON)
95
add_compile_definitions(__STDC_CONSTANT_MACROS)
96
endif()
97
98
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
99
set(MACOSX ON)
100
set(USING_EGL OFF)
101
endif()
102
103
if(${CMAKE_SYSTEM_NAME} MATCHES "Android")
104
set(ANDROID ON)
105
endif()
106
107
# We only support Vulkan on Unix, macOS (by MoltenVK), Android and Windows.
108
if(ANDROID OR WIN32 OR (UNIX AND NOT ARM_NO_VULKAN))
109
set(VULKAN ON)
110
endif()
111
112
# Default to bundled SDL2 on macOS, system SDL2 elsewhere.
113
if(APPLE AND NOT IOS)
114
set(DEFAULT_USE_SYSTEM_LIBSDL2 OFF)
115
else()
116
set(DEFAULT_USE_SYSTEM_LIBSDL2 ON)
117
endif()
118
119
if(CMAKE_CXX_COMPILER MATCHES "webos" OR
120
CMAKE_CXX_COMPILER MATCHES "starfish")
121
set(WEBOS ON)
122
endif()
123
124
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
125
if(NOT IOS)
126
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/sdl)
127
endif()
128
129
include(CheckCXXSourceCompiles)
130
include(GNUInstallDirs)
131
132
add_compile_definitions(ASSETS_DIR="${CMAKE_INSTALL_FULL_DATADIR}/ppsspp/assets/")
133
134
if(OPENXR AND NOT ARMV7_DEVICE)
135
add_compile_definitions(OPENXR)
136
add_subdirectory(ext/OpenXR-SDK)
137
message("OpenXR enabled")
138
endif()
139
140
if(GOLD)
141
add_compile_definitions(GOLD)
142
message("Gold Build")
143
if(IOS_APP_STORE)
144
message("WARNING: Gold build for iOS is deprecated")
145
endif()
146
else()
147
message("Non-gold Build")
148
endif()
149
150
if(USE_IAP)
151
if(GOLD)
152
message(FATAL_ERROR "USE_IAP and GOLD can't be enabled together")
153
endif()
154
if(NOT IOS_APP_STORE)
155
message(FATAL_ERROR "USE_IAP can only be enabled in app store builds")
156
endif()
157
message("USE_IAP for iOS enabled")
158
add_compile_definitions(USE_IAP)
159
endif()
160
161
if(IOS_APP_STORE)
162
add_compile_definitions(PPSSPP_PLATFORM_IOS_APP_STORE)
163
add_compile_definitions(GLES_SILENCE_DEPRECATION)
164
# Set a global default to not generate schemes for each target.
165
# Makes using XCode sligthly more sane.
166
set(CMAKE_XCODE_GENERATE_SCHEME NO)
167
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION FALSE)
168
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE DISABLED)
169
message("iOS App Store build")
170
elseif(IOS)
171
message("iOS sideload build")
172
endif()
173
174
# User-editable options (go into CMakeCache.txt)
175
# :: Processors
176
option(ARMV7 "Set to ON if targeting an ARMv7 processor" ${ARMV7_DEVICE})
177
option(ARM "Set to ON if targeting an ARM processor" ${ARM_DEVICE})
178
option(MIPS "Set to ON if targeting a MIPS processor" ${MIPS_DEVICE})
179
option(RISCV64 "Set to ON if targeting a RISCV64 processor" ${RISCV64_DEVICE})
180
option(LOONGARCH64 "Set to ON if targeting a LOONGARCH64 processor" ${LOONGARCH64_DEVICE})
181
option(X86 "Set to ON if targeting an X86 processor" ${X86_DEVICE})
182
option(X86_64 "Set to ON if targeting an X86_64 processor" ${X86_64_DEVICE})
183
# :: Environments
184
option(USING_EGL "Set to ON if target environment uses EGL" ${USING_EGL})
185
option(USING_FBDEV "Set to ON if target environment uses fbdev (eg. Pandora)" ${USING_FBDEV})
186
option(USING_GLES2 "Set to ON if target device uses OpenGL ES 2.0" ${USING_GLES2})
187
option(USING_X11_VULKAN "Set to OFF if target environment doesn't use X11 for Vulkan" ON)
188
option(USE_WAYLAND_WSI "Enable or disable Wayland WSI support for Vulkan" ON)
189
option(USE_VULKAN_DISPLAY_KHR "Enable or disable full screen display of Vulkan" ${USE_VULKAN_DISPLAY_KHR})
190
# :: Frontends
191
option(USING_QT_UI "Set to ON if you wish to use the Qt frontend wrapper" ${USING_QT_UI})
192
option(MOBILE_DEVICE "Set to ON when targeting a mobile device" ${MOBILE_DEVICE})
193
option(HEADLESS "Set to OFF to not generate the PPSSPPHeadless target" ${HEADLESS})
194
option(ATLAS_TOOL "Set to OFF to not generate the ATLAS_TOOL target" ${ATLAS_TOOL})
195
option(UNITTEST "Set to ON to generate the unittest target" ${UNITTEST})
196
option(SIMULATOR "Set to ON when targeting an x86 simulator of an ARM platform" ${SIMULATOR})
197
option(LIBRETRO "Set to ON to generate the libretro target" OFF)
198
# :: Options
199
option(USE_LIBNX "Set to ON to build for Switch(libnx)" OFF)
200
option(USE_FFMPEG "Build with FFMPEG support" ON)
201
option(USE_DISCORD "Build with Discord support" ON)
202
option(USE_MINIUPNPC "Build with miniUPnPc support" ON)
203
option(USE_SYSTEM_SNAPPY "Dynamically link against system snappy" ${USE_SYSTEM_SNAPPY})
204
option(USE_SYSTEM_FFMPEG "Dynamically link against system FFMPEG" ${USE_SYSTEM_FFMPEG})
205
option(USE_SYSTEM_LIBZIP "Dynamically link against system libzip" ${USE_SYSTEM_LIBZIP})
206
option(USE_SYSTEM_LIBSDL2 "Dynamically link against system SDL2" ${DEFAULT_USE_SYSTEM_LIBSDL2})
207
option(USE_SYSTEM_LIBPNG "Dynamically link against system libpng" ON)
208
option(USE_SYSTEM_ZSTD "Dynamically link against system zstd" ${USE_SYSTEM_ZSTD})
209
option(USE_SYSTEM_MINIUPNPC "Dynamically link against system miniUPnPc" ${USE_SYSTEM_MINIUPNPC})
210
option(USE_ASAN "Use address sanitizer" OFF)
211
option(USE_UBSAN "Use undefined behaviour sanitizer" OFF)
212
option(USE_CCACHE "Use ccache if detected" ON)
213
option(USE_NO_MMAP "Disable mmap usage" OFF)
214
option(USE_IAP "IAP enabled" OFF)
215
option(GOLD "Gold build" OFF)
216
217
if(USE_CCACHE)
218
include(ccache)
219
endif()
220
221
if(WEBOS)
222
set(ARMV7 ON)
223
set(USING_X11_VULKAN OFF)
224
set(USING_GLES2 ON)
225
set(USE_SYSTEM_ZSTD OFF)
226
endif()
227
228
if(UNIX AND NOT (APPLE OR ANDROID) AND VULKAN)
229
if(USING_X11_VULKAN)
230
message("Using X11 for Vulkan")
231
find_package(X11)
232
include_directories(${X11_Xlib_INCLUDE_PATH})
233
add_compile_definitions(VK_USE_PLATFORM_XLIB_KHR)
234
else()
235
message("NOT using X11 for Vulkan")
236
endif()
237
238
# add_compile_definitions(VK_USE_PLATFORM_XCB_KHR)
239
find_package(Wayland)
240
if(NOT WAYLAND_FOUND)
241
message(STATUS "Could not find Wayland libraries, disabling Wayland WSI support for Vulkan.")
242
elseif(USE_WAYLAND_WSI)
243
include_directories(${WAYLAND_INCLUDE_DIR})
244
add_compile_definitions(VK_USE_PLATFORM_WAYLAND_KHR)
245
endif()
246
247
if(USE_VULKAN_DISPLAY_KHR)
248
message(STATUS "Using experimental full-screen display for Vulkan.")
249
add_compile_definitions(VK_USE_PLATFORM_DISPLAY_KHR)
250
endif()
251
endif()
252
253
if(LIBRETRO)
254
add_compile_definitions(__LIBRETRO__)
255
add_compile_definitions(GLEW_NO_GLU)
256
if(NOT MSVC)
257
add_compile_options(-fPIC)
258
endif()
259
add_compile_definitions(HAVE_LIBRETRO_VFS)
260
endif()
261
262
if(ANDROID)
263
set(MOBILE_DEVICE ON)
264
set(USING_GLES2 ON)
265
endif()
266
267
if(ANDROID AND NOT LIBRETRO)
268
set(CoreLibName ppsspp_jni)
269
set(CoreLinkType SHARED)
270
else()
271
set(CoreLibName Core)
272
set(CoreLinkType STATIC)
273
endif()
274
275
if(NOT ANDROID AND NOT WIN32 AND (NOT APPLE OR IOS))
276
set(HTTPS_NOT_AVAILABLE ON)
277
endif()
278
279
# Made this flag negative because it's hopefully quite temporary and didn't
280
# want to have to update all build systems.
281
if(HTTPS_NOT_AVAILABLE)
282
add_compile_definitions(HTTPS_NOT_AVAILABLE)
283
endif()
284
285
# Disable the usage of MMAP for the memory system.
286
# It is not tested on all platforms and can cause issues.
287
if(USE_NO_MMAP)
288
add_compile_definitions(NO_MMAP MASKED_PSP_MEMORY)
289
endif()
290
291
# Work around for some misfeature of the current glslang build system
292
include_directories(ext/glslang)
293
294
# Not sure if this is the best way - what about system glew?
295
# Anyway, glew will be going away anyway.
296
include_directories(ext/glew)
297
298
if(OPENXR AND NOT ARMV7_DEVICE)
299
set(OPENGL_LIBRARIES GLESv3 EGL)
300
elseif(NOT OPENGL_LIBRARIES AND USING_GLES2)
301
set(OPENGL_LIBRARIES GLESv2 EGL)
302
endif()
303
304
if(NOT OPENGL_LIBRARIES)
305
if(POLICY CMP0072)
306
cmake_policy(SET CMP0072 NEW)
307
endif()
308
find_package(OpenGL REQUIRED)
309
endif()
310
311
if(USING_EGL)
312
if(NOT EGL_LIBRARIES)
313
set(EGL_LIBRARIES EGL)
314
endif()
315
list(APPEND OPENGL_LIBRARIES ${EGL_LIBRARIES})
316
endif()
317
318
if(NOT LIBRETRO AND NOT IOS AND NOT MACOSX)
319
find_package(SDL2)
320
find_package(SDL2_ttf)
321
find_package(Fontconfig)
322
323
# TODO: this can be removed once CI supports newer SDL2_ttf
324
if (NOT SDL2_ttf_FOUND)
325
find_package(PkgConfig)
326
if(PkgConfig_FOUND)
327
pkg_check_modules(SDL2_ttf_PKGCONFIG IMPORTED_TARGET SDL2_ttf)
328
endif()
329
endif()
330
endif()
331
332
if(MACOSX AND NOT IOS)
333
if(USE_SYSTEM_LIBSDL2)
334
find_package(SDL2)
335
find_package(SDL2_ttf)
336
else()
337
find_library(SDL2Fwk SDL2 REQUIRED PATHS SDL/macOS)
338
message(STATUS "found SDL2Fwk=${SDL2Fwk}")
339
add_compile_definitions(HAVE_SYSCTLBYNAME)
340
endif()
341
endif()
342
343
include(FindThreads)
344
345
if(APPLE)
346
find_library(COCOA_LIBRARY Cocoa)
347
find_library(IOKIT_LIBRARY IOKit)
348
find_library(QUARTZ_CORE_LIBRARY QuartzCore)
349
endif()
350
351
include_directories("${CMAKE_SOURCE_DIR}")
352
353
if(ANDROID_LEGACY)
354
add_compile_definitions(ANDROID_LEGACY)
355
endif()
356
if(USING_EGL)
357
add_compile_definitions(USING_EGL)
358
endif()
359
if(USING_FBDEV)
360
add_compile_definitions(USING_FBDEV EGL_NO_X11)
361
endif()
362
if(USING_GLES2)
363
add_compile_definitions(USING_GLES2)
364
endif()
365
if(MOBILE_DEVICE)
366
add_compile_definitions(MOBILE_DEVICE)
367
endif()
368
369
if(NOT CMAKE_BUILD_TYPE)
370
message(STATUS "No build type selected, default to Release")
371
set(CMAKE_BUILD_TYPE "Release")
372
else()
373
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
374
endif()
375
376
message("CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
377
378
# Let's not use elseif here so we can catch dupes.
379
if(ARMV7)
380
message("Generating for ARMv7, ${CMAKE_BUILD_TYPE}")
381
endif()
382
if(ARM)
383
message("Generating for ARM, ${CMAKE_BUILD_TYPE}")
384
endif()
385
if(MIPS AND X86)
386
message("Generating for MIPS in x86 mode, ${CMAKE_BUILD_TYPE}")
387
endif()
388
if(MIPS)
389
message("Generating for MIPS, ${CMAKE_BUILD_TYPE}")
390
endif()
391
if(RISCV64)
392
message("Generating for RISCV64, ${CMAKE_BUILD_TYPE}")
393
endif()
394
if(LOONGARCH64)
395
message("Generating for LOONGARCH64, ${CMAKE_BUILD_TYPE}")
396
endif()
397
if(X86)
398
message("Generating for x86, ${CMAKE_BUILD_TYPE}")
399
endif()
400
if(X86_64)
401
message("Generating for x86_64, ${CMAKE_BUILD_TYPE}")
402
endif()
403
if(ARM64)
404
message("Generating for ARMv8, ${CMAKE_BUILD_TYPE}")
405
endif()
406
407
if(NOT MSVC)
408
# NEON optimizations in libpng17 seem to cause PNG load errors, see #14485.
409
add_compile_definitions(PNG_ARM_NEON_OPT=0)
410
411
add_compile_options(-Wall -Werror=return-type -Wno-unused-function -Wno-sign-compare -Wno-unused-but-set-variable "$<$<COMPILE_LANGUAGE:CXX>:-Wno-reorder>" -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-variable -Wno-error=incompatible-pointer-types)
412
if(NOT CLANG)
413
# This one is very useful but has many false positives.
414
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Wno-class-memaccess>")
415
else()
416
add_compile_options(-Wno-deprecated-declarations -Wno-missing-braces)
417
endif()
418
419
if(ANDROID)
420
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-std=c++17>")
421
endif()
422
if(CLANG)
423
add_compile_options(
424
-Wno-nullability-completeness
425
-Wno-tautological-pointer-compare
426
-Wno-deprecated-register
427
-Wno-sign-conversion
428
-Wno-shorten-64-to-32
429
)
430
if(MACOSX OR IOS)
431
# Hack around a bad check for __GNUC__ in basis_universal that makes it use old stuff on iOS
432
add_compile_options(-Wno-deprecated-builtins)
433
endif()
434
endif()
435
436
if(USE_ASAN)
437
message("Address sanitizer enabled (DEBUG only)")
438
add_compile_options("$<$<CONFIG:Debug>:-fsanitize=address>")
439
add_link_options("$<$<CONFIG:Debug>:-fsanitize=address>")
440
add_compile_definitions(USE_ASAN)
441
endif()
442
if(USE_UBSAN)
443
message("Undefined behaviour sanitizer enabled (DEBUG only)")
444
add_compile_options("$<$<CONFIG:Debug>:-fsanitize=undefined>")
445
add_link_options("$<$<CONFIG:Debug>:-fsanitize=undefined>")
446
447
# UBSAN is a collection of sanitizers, including vtpr, which reqiuires RTTI.
448
# ext/glslang disables RTTI by default using the `ENABLE_RTTI` option.
449
# If RTTI is disabled, we must also disable the vtpr sanitizer.
450
if(NOT ENABLE_RTTI)
451
add_compile_options("$<$<CONFIG:Debug>:-fno-sanitize=vptr>")
452
add_link_options("$<$<CONFIG:Debug>:-fno-sanitize=vptr>")
453
endif()
454
endif()
455
456
include(CheckSymbolExists)
457
458
add_compile_definitions("$<$<CONFIG:Debug>:_DEBUG>")
459
460
# Enable checking printf-like format strings (also works for logging functions)
461
add_compile_options(-Wformat)
462
463
# Disable some warnings
464
add_compile_options(-Wno-multichar)
465
466
# Don't compile with strict aliasing, we're not 100% aliasing-safe
467
add_compile_options(-fno-strict-aliasing)
468
if(${CMAKE_C_COMPILER_ID} STREQUAL "Intel")
469
add_compile_options("$<$<CONFIG:Release>:-parallel;-fopenmp>")
470
endif()
471
472
add_compile_options(-fno-math-errno)
473
474
if(X86 OR X86_64)
475
# enable sse2 code generation
476
if(NOT MACOSX)
477
add_compile_options(-msse2)
478
endif()
479
if(NOT X86_64 AND NOT CLANG)
480
add_compile_options(-mfpmath=sse)
481
# add_compile_options(-mstackrealign)
482
endif()
483
endif()
484
485
if(IOS)
486
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
487
elseif(APPLE AND NOT CMAKE_CROSSCOMPILING)
488
if(LIBRETRO AND ARM64)
489
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
490
else()
491
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
492
endif()
493
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-stdlib=libc++>" -U__STRICT_ANSI__)
494
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
495
elseif(NOT ANDROID)
496
# TODO: See if we can get rid of no-psabi
497
if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Intel" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
498
add_compile_options(-Wno-psabi)
499
endif()
500
add_compile_definitions(_XOPEN_SOURCE=700)
501
add_compile_definitions(_XOPEN_SOURCE_EXTENDED __BSD_VISIBLE=1 _BSD_SOURCE _DEFAULT_SOURCE)
502
if(CMAKE_SYSTEM_NAME MATCHES "Linux|SunOS" OR MINGW)
503
add_compile_definitions(_LARGEFILE64_SOURCE=1 _FILE_OFFSET_BITS=64)
504
endif()
505
if(${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD")
506
add_compile_definitions(_NETBSD_SOURCE)
507
endif()
508
elseif(ANDROID)
509
add_compile_options(-fsigned-char)
510
endif()
511
512
check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL)
513
if(HAVE_GETAUXVAL)
514
add_definitions(-DHAVE_GETAUXVAL)
515
endif()
516
517
check_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
518
if(HAVE_ELF_AUX_INFO)
519
add_definitions(-DHAVE_ELF_AUX_INFO)
520
endif()
521
else()
522
# Disable warnings about MS-specific _s variants of libc functions
523
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
524
if (NOT CLANG)
525
add_compile_options(-MP)
526
endif()
527
add_link_options(/NODEFAULTLIB:"libcmt.lib")
528
endif()
529
530
if(WIN32)
531
add_compile_definitions(_UNICODE UNICODE)
532
add_compile_definitions(USING_WIN_UI)
533
endif()
534
535
if(NOT ANDROID)
536
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
537
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
538
endif()
539
540
# This sets up the MSVC project dirs according to the physical project dirs
541
macro(setup_target_project TargetName ProjectDir)
542
get_property(TargetSources TARGET "${TargetName}" PROPERTY SOURCES)
543
foreach(Source ${TargetSources})
544
# Figure out the file's path relative to the ProjectDir
545
# NOTE: &#$@ double-quoted regexps
546
string(REGEX REPLACE "${ProjectDir}" "" RelativePath "${Source}")
547
string(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" RelativePath "${RelativePath}")
548
string(REGEX REPLACE "^[\\\\/]" "" RelativePath "${RelativePath}")
549
string(REGEX REPLACE "/" "\\\\\\\\" RelativePath "${RelativePath}")
550
# put the source file in a source_group equivalent to the relative path
551
source_group("${RelativePath}" FILES ${Source})
552
endforeach()
553
endmacro()
554
555
add_subdirectory(ext)
556
557
set(CommonJIT
558
Core/MIPS/JitCommon/JitCommon.cpp
559
Core/MIPS/JitCommon/JitCommon.h
560
Core/MIPS/JitCommon/JitBlockCache.cpp
561
Core/MIPS/JitCommon/JitBlockCache.h
562
Core/MIPS/JitCommon/JitState.cpp
563
Core/MIPS/JitCommon/JitState.h
564
)
565
566
set(CommonX86
567
Common/ABI.cpp
568
Common/ABI.h
569
Common/CPUDetect.cpp
570
Common/CPUDetect.h
571
Common/Thunk.cpp
572
Common/Thunk.h
573
Common/x64Analyzer.cpp
574
Common/x64Analyzer.h
575
Common/x64Emitter.cpp
576
Common/x64Emitter.h
577
)
578
source_group(x86 FILES ${CommonX86})
579
580
set(CommonARM
581
Common/ArmCPUDetect.cpp
582
Common/ArmEmitter.h
583
Common/ArmEmitter.cpp
584
)
585
source_group(ARM FILES ${CommonARM})
586
587
set(CommonARM64
588
Common/Arm64Emitter.h
589
Common/Arm64Emitter.cpp
590
Common/ArmEmitter.h
591
Common/ArmEmitter.cpp
592
Core/Util/DisArm64.h
593
Core/Util/DisArm64.cpp
594
)
595
source_group(ARM64 FILES ${CommonARM64})
596
597
set(CommonMIPS
598
Common/MipsCPUDetect.cpp
599
Common/MipsEmitter.cpp
600
Common/MipsEmitter.h
601
)
602
source_group(MIPS FILES ${CommonMIPS})
603
604
set(CommonRISCV64
605
${CommonJIT}
606
Common/RiscVCPUDetect.cpp
607
Common/RiscVEmitter.cpp
608
Common/RiscVEmitter.h
609
Core/MIPS/fake/FakeJit.cpp
610
Core/MIPS/fake/FakeJit.h
611
)
612
source_group(RISCV64 FILES ${CommonRISCV64})
613
614
set(CommonLOONGARCH64
615
${CommonJIT}
616
Common/LoongArchCPUDetect.cpp
617
Common/LoongArch64Emitter.cpp
618
Common/LoongArch64Emitter.h
619
Core/MIPS/fake/FakeJit.cpp
620
Core/MIPS/fake/FakeJit.h
621
)
622
source_group(LOONGARCH64 FILES ${CommonLOONGARCH64})
623
624
if(WIN32)
625
set(CommonD3D
626
Common/GPU/D3D11/thin3d_d3d11.cpp
627
Common/GPU/D3D11/D3D11Loader.cpp
628
Common/GPU/D3D11/D3D11Loader.h
629
)
630
endif()
631
632
set(CommonVR
633
Common/VR/OpenXRLoader.cpp
634
Common/VR/OpenXRLoader.h
635
Common/VR/PPSSPPVR.cpp
636
Common/VR/PPSSPPVR.h
637
Common/VR/VRBase.cpp
638
Common/VR/VRBase.h
639
Common/VR/VRFramebuffer.cpp
640
Common/VR/VRFramebuffer.h
641
Common/VR/VRInput.cpp
642
Common/VR/VRInput.h
643
Common/VR/VRMath.cpp
644
Common/VR/VRMath.h
645
Common/VR/VRRenderer.cpp
646
Common/VR/VRRenderer.h
647
)
648
include_directories(ext/OpenXR-SDK/include)
649
650
# For ext/sol includes, that are usually included as sol/*.hpp
651
include_directories(ext)
652
653
add_library(Common STATIC
654
${CommonX86}
655
${CommonARM}
656
${CommonARM64}
657
${CommonMIPS}
658
${CommonRISCV64}
659
${CommonLOONGARCH64}
660
${CommonD3D}
661
${CommonVR}
662
Common/Serialize/Serializer.cpp
663
Common/Serialize/Serializer.h
664
Common/Serialize/SerializeDeque.h
665
Common/Serialize/SerializeFuncs.h
666
Common/Serialize/SerializeList.h
667
Common/Serialize/SerializeMap.h
668
Common/Serialize/SerializeSet.h
669
Common/Crypto/md5.cpp
670
Common/Crypto/md5.h
671
Common/Crypto/sha1.cpp
672
Common/Crypto/sha1.h
673
Common/Crypto/sha256.cpp
674
Common/Crypto/sha256.h
675
Common/Data/Collections/ConstMap.h
676
Common/Data/Collections/FixedSizeQueue.h
677
Common/Data/Collections/Hashmaps.h
678
Common/Data/Collections/TinySet.h
679
Common/Data/Collections/FastVec.h
680
Common/Data/Collections/CharQueue.h
681
Common/Data/Collections/CyclicBuffer.h
682
Common/Data/Collections/ThreadSafeList.h
683
Common/Data/Color/RGBAUtil.cpp
684
Common/Data/Color/RGBAUtil.h
685
Common/Data/Convert/ColorConv.cpp
686
Common/Data/Convert/ColorConv.h
687
Common/Data/Convert/SmallDataConvert.cpp
688
Common/Data/Convert/SmallDataConvert.h
689
Common/Data/Encoding/Base64.cpp
690
Common/Data/Encoding/Base64.h
691
Common/Data/Encoding/Compression.cpp
692
Common/Data/Encoding/Compression.h
693
Common/Data/Encoding/Shiftjis.h
694
Common/Data/Encoding/Utf8.cpp
695
Common/Data/Encoding/Utf8.h
696
Common/Data/Encoding/Utf16.h
697
Common/Data/Format/RIFF.cpp
698
Common/Data/Format/RIFF.h
699
Common/Data/Format/IniFile.cpp
700
Common/Data/Format/IniFile.h
701
Common/Data/Format/JSONReader.h
702
Common/Data/Format/JSONReader.cpp
703
Common/Data/Format/JSONWriter.h
704
Common/Data/Format/JSONWriter.cpp
705
Common/Data/Format/DDSLoad.cpp
706
Common/Data/Format/DDSLoad.h
707
Common/Data/Format/PNGLoad.cpp
708
Common/Data/Format/PNGLoad.h
709
Common/Data/Format/ZIMLoad.cpp
710
Common/Data/Format/ZIMLoad.h
711
Common/Data/Format/ZIMSave.cpp
712
Common/Data/Format/ZIMSave.h
713
Common/Data/Hash/Hash.cpp
714
Common/Data/Hash/Hash.h
715
Common/Data/Text/I18n.cpp
716
Common/Data/Text/I18n.h
717
Common/Data/Text/Parsers.cpp
718
Common/Data/Text/Parsers.h
719
Common/Data/Text/WrapText.cpp
720
Common/Data/Text/WrapText.h
721
Common/Data/Random/Rng.h
722
Common/File/VFS/VFS.h
723
Common/File/VFS/VFS.cpp
724
Common/File/VFS/ZipFileReader.cpp
725
Common/File/VFS/ZipFileReader.h
726
Common/File/VFS/DirectoryReader.cpp
727
Common/File/VFS/DirectoryReader.h
728
Common/File/AndroidStorage.h
729
Common/File/AndroidStorage.cpp
730
Common/File/AndroidContentURI.h
731
Common/File/AndroidContentURI.cpp
732
Common/File/DiskFree.h
733
Common/File/DiskFree.cpp
734
Common/File/Path.h
735
Common/File/Path.cpp
736
Common/File/PathBrowser.h
737
Common/File/PathBrowser.cpp
738
Common/File/FileUtil.cpp
739
Common/File/FileUtil.h
740
Common/File/DirListing.cpp
741
Common/File/DirListing.h
742
Common/File/FileDescriptor.cpp
743
Common/File/FileDescriptor.h
744
Common/GPU/DataFormat.h
745
Common/GPU/MiscTypes.h
746
Common/GPU/GPUBackendCommon.cpp
747
Common/GPU/GPUBackendCommon.h
748
Common/GPU/thin3d.cpp
749
Common/GPU/thin3d.h
750
Common/GPU/thin3d_create.h
751
Common/GPU/Shader.cpp
752
Common/GPU/Shader.h
753
Common/GPU/ShaderWriter.cpp
754
Common/GPU/ShaderWriter.h
755
Common/GPU/ShaderTranslation.h
756
Common/GPU/ShaderTranslation.cpp
757
Common/GPU/OpenGL/GLCommon.h
758
Common/GPU/OpenGL/GLDebugLog.cpp
759
Common/GPU/OpenGL/GLDebugLog.h
760
Common/GPU/OpenGL/GLSLProgram.cpp
761
Common/GPU/OpenGL/GLSLProgram.h
762
Common/GPU/OpenGL/gl3stub.c
763
Common/GPU/OpenGL/gl3stub.h
764
Common/GPU/OpenGL/GLFeatures.cpp
765
Common/GPU/OpenGL/GLFeatures.h
766
Common/GPU/OpenGL/GLFrameData.cpp
767
Common/GPU/OpenGL/GLFrameData.h
768
Common/GPU/OpenGL/thin3d_gl.cpp
769
Common/GPU/OpenGL/GLMemory.cpp
770
Common/GPU/OpenGL/GLMemory.h
771
Common/GPU/OpenGL/GLRenderManager.cpp
772
Common/GPU/OpenGL/GLRenderManager.h
773
Common/GPU/OpenGL/GLQueueRunner.cpp
774
Common/GPU/OpenGL/GLQueueRunner.h
775
Common/GPU/OpenGL/DataFormatGL.cpp
776
Common/GPU/OpenGL/DataFormatGL.h
777
Common/GPU/Vulkan/VulkanBarrier.cpp
778
Common/GPU/Vulkan/VulkanBarrier.h
779
Common/GPU/Vulkan/VulkanDebug.cpp
780
Common/GPU/Vulkan/VulkanDebug.h
781
Common/GPU/Vulkan/VulkanContext.cpp
782
Common/GPU/Vulkan/VulkanContext.h
783
Common/GPU/Vulkan/VulkanDescSet.cpp
784
Common/GPU/Vulkan/VulkanDescSet.h
785
Common/GPU/Vulkan/VulkanFramebuffer.cpp
786
Common/GPU/Vulkan/VulkanFramebuffer.h
787
Common/GPU/Vulkan/VulkanImage.cpp
788
Common/GPU/Vulkan/VulkanImage.h
789
Common/GPU/Vulkan/VulkanLoader.cpp
790
Common/GPU/Vulkan/VulkanLoader.h
791
Common/GPU/Vulkan/VulkanMemory.cpp
792
Common/GPU/Vulkan/VulkanMemory.h
793
Common/GPU/Vulkan/VulkanProfiler.cpp
794
Common/GPU/Vulkan/VulkanProfiler.h
795
Common/GPU/Vulkan/thin3d_vulkan.cpp
796
Common/GPU/Vulkan/VulkanRenderManager.cpp
797
Common/GPU/Vulkan/VulkanRenderManager.h
798
Common/GPU/Vulkan/VulkanQueueRunner.cpp
799
Common/GPU/Vulkan/VulkanQueueRunner.h
800
Common/GPU/Vulkan/VulkanFrameData.cpp
801
Common/GPU/Vulkan/VulkanFrameData.h
802
Common/Input/GestureDetector.cpp
803
Common/Input/GestureDetector.h
804
Common/Input/KeyCodes.h
805
Common/Input/InputState.cpp
806
Common/Input/InputState.h
807
Common/Math/SIMDHeaders.h
808
Common/Math/SIMDHeaders.h
809
Common/Math/curves.cpp
810
Common/Math/curves.h
811
Common/Math/expression_parser.cpp
812
Common/Math/expression_parser.h
813
Common/Math/lin/matrix4x4.cpp
814
Common/Math/lin/matrix4x4.h
815
Common/Math/lin/vec3.cpp
816
Common/Math/lin/vec3.h
817
Common/Math/math_util.cpp
818
Common/Math/math_util.h
819
Common/Math/Statistics.h
820
Common/Math/Statistics.cpp
821
Common/Net/HTTPClient.cpp
822
Common/Net/HTTPClient.h
823
Common/Net/HTTPHeaders.cpp
824
Common/Net/HTTPHeaders.h
825
Common/Net/HTTPNaettRequest.cpp
826
Common/Net/HTTPNaettRequest.h
827
Common/Net/HTTPRequest.cpp
828
Common/Net/HTTPRequest.h
829
Common/Net/HTTPServer.cpp
830
Common/Net/HTTPServer.h
831
Common/Net/NetBuffer.cpp
832
Common/Net/NetBuffer.h
833
Common/Net/Resolve.cpp
834
Common/Net/Resolve.h
835
Common/Net/Sinks.cpp
836
Common/Net/Sinks.h
837
Common/Net/SocketCompat.h
838
Common/Net/URL.cpp
839
Common/Net/URL.h
840
Common/Net/WebsocketServer.cpp
841
Common/Net/WebsocketServer.h
842
Common/Profiler/Profiler.cpp
843
Common/Profiler/Profiler.h
844
Common/Render/AtlasGen.cpp
845
Common/Render/AtlasGen.h
846
Common/Render/TextureAtlas.cpp
847
Common/Render/TextureAtlas.h
848
Common/Render/DrawBuffer.cpp
849
Common/Render/DrawBuffer.h
850
Common/Render/ManagedTexture.cpp
851
Common/Render/ManagedTexture.h
852
Common/Render/Text/draw_text.cpp
853
Common/Render/Text/draw_text.h
854
Common/Render/Text/draw_text_android.cpp
855
Common/Render/Text/draw_text_android.h
856
Common/Render/Text/draw_text_sdl.cpp
857
Common/Render/Text/draw_text_sdl.h
858
Common/Render/Text/draw_text_win.cpp
859
Common/Render/Text/draw_text_win.h
860
Common/Render/Text/draw_text_uwp.cpp
861
Common/Render/Text/draw_text_uwp.h
862
Common/Audio/AudioBackend.h
863
Common/System/Display.cpp
864
Common/System/Display.h
865
Common/System/System.h
866
Common/System/NativeApp.h
867
Common/System/Request.cpp
868
Common/System/Request.h
869
Common/System/OSD.cpp
870
Common/System/OSD.h
871
Common/Thread/Channel.h
872
Common/Thread/ParallelLoop.cpp
873
Common/Thread/ParallelLoop.h
874
Common/Thread/Promise.h
875
Common/Thread/ThreadUtil.cpp
876
Common/Thread/ThreadUtil.h
877
Common/Thread/ThreadManager.cpp
878
Common/Thread/ThreadManager.h
879
Common/UI/AsyncImageFileView.cpp
880
Common/UI/AsyncImageFileView.h
881
Common/UI/Root.cpp
882
Common/UI/Root.h
883
Common/UI/Screen.cpp
884
Common/UI/Screen.h
885
Common/UI/UI.cpp
886
Common/UI/UI.h
887
Common/UI/Context.cpp
888
Common/UI/Context.h
889
Common/UI/IconCache.cpp
890
Common/UI/IconCache.h
891
Common/UI/UIScreen.cpp
892
Common/UI/UIScreen.h
893
Common/UI/Notice.cpp
894
Common/UI/Notice.h
895
Common/UI/Tween.cpp
896
Common/UI/Tween.h
897
Common/UI/View.cpp
898
Common/UI/View.h
899
Common/UI/ViewGroup.cpp
900
Common/UI/ViewGroup.h
901
Common/UI/ScrollView.cpp
902
Common/UI/ScrollView.h
903
Common/UI/TabHolder.cpp
904
Common/UI/TabHolder.h
905
Common/UI/PopupScreens.cpp
906
Common/UI/PopupScreens.h
907
Common/BitScan.h
908
Common/BitSet.h
909
Common/Buffer.h
910
Common/Buffer.cpp
911
Common/CodeBlock.h
912
Common/Common.h
913
Common/CommonFuncs.h
914
Common/CommonTypes.h
915
Common/DbgNew.h
916
Common/FakeEmitter.h
917
Common/FakeCPUDetect.cpp
918
Common/ExceptionHandlerSetup.cpp
919
Common/ExceptionHandlerSetup.h
920
Common/GhidraClient.h
921
Common/GhidraClient.cpp
922
Common/Log.h
923
Common/Log.cpp
924
Common/Log/ConsoleListener.cpp
925
Common/Log/ConsoleListener.h
926
Common/Log/LogManager.cpp
927
Common/Log/LogManager.h
928
Common/LogReporting.cpp
929
Common/LogReporting.h
930
Common/MemArenaAndroid.cpp
931
Common/MemArenaDarwin.cpp
932
Common/MemArenaPosix.cpp
933
Common/MemArenaWin32.cpp
934
Common/MemArenaHorizon.cpp
935
Common/MemArena.h
936
Common/MemoryUtil.cpp
937
Common/MemoryUtilHorizon.cpp
938
Common/MemoryUtil.h
939
Common/OSVersion.cpp
940
Common/OSVersion.h
941
Common/StringUtils.cpp
942
Common/StringUtils.h
943
Common/SysError.h
944
Common/SysError.cpp
945
Common/TimeUtil.cpp
946
Common/TimeUtil.h
947
)
948
949
if(LIBRETRO)
950
target_include_directories(Common PRIVATE libretro/libretro-common/include)
951
endif()
952
953
include_directories(Common)
954
setup_target_project(Common Common)
955
956
if(IOS)
957
target_compile_definitions(Common PUBLIC GLES_SILENCE_DEPRECATION)
958
endif()
959
960
target_link_libraries(Common Ext::Snappy cpu_features)
961
962
if(NOT LIBRETRO)
963
target_link_libraries(Common imgui)
964
endif()
965
966
if(ARM64)
967
if(ANDROID)
968
target_link_libraries(Common adrenotools)
969
endif()
970
endif()
971
972
if(TARGET Ext::GLEW)
973
target_link_libraries(Common Ext::GLEW)
974
endif()
975
976
if(USING_GLES2 OR (USING_EGL AND NOT USING_FBDEV))
977
find_package(X11)
978
endif()
979
980
add_library(gason STATIC
981
ext/gason/gason.cpp
982
ext/gason/gason.h
983
)
984
985
add_library(vma STATIC
986
ext/vma/vk_mem_alloc.cpp
987
ext/vma/vk_mem_alloc.h
988
)
989
990
if(USE_FFMPEG)
991
if(NOT FFMPEG_DIR)
992
if(NOT USE_SYSTEM_FFMPEG)
993
if(ANDROID)
994
if(ARMV7)
995
set(PLATFORM_ARCH "android/armv7")
996
elseif(ARM64)
997
set(PLATFORM_ARCH "android/arm64")
998
elseif(X86_64)
999
set(PLATFORM_ARCH "android/x86_64")
1000
elseif(X86)
1001
set(PLATFORM_ARCH "android/x86")
1002
endif()
1003
elseif(IOS)
1004
if(IOS_PLATFORM STREQUAL "TVOS")
1005
set(PLATFORM_ARCH "tvos/arm64")
1006
else()
1007
set(PLATFORM_ARCH "ios/universal")
1008
endif()
1009
elseif(MACOSX)
1010
set(PLATFORM_ARCH "macosx/universal")
1011
elseif(LINUX)
1012
if(ARMV7)
1013
set(PLATFORM_ARCH "linux/armv7")
1014
elseif(ARM64)
1015
set(PLATFORM_ARCH "linux/aarch64")
1016
elseif(ARM)
1017
set(PLATFORM_ARCH "linux/arm")
1018
elseif(MIPS)
1019
set(PLATFORM_ARCH "linux/mips32")
1020
elseif(RISCV64)
1021
set(PLATFORM_ARCH "linux/riscv64")
1022
elseif(LOONGARCH64)
1023
set(PLATFORM_ARCH "linux/loongarch64")
1024
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
1025
set(PLATFORM_ARCH "linux/x86_64")
1026
elseif(X86)
1027
set(PLATFORM_ARCH "linux/x86")
1028
endif()
1029
elseif(WIN32)
1030
if(X86_64)
1031
set(PLATFORM_ARCH "Windows/x86_64")
1032
elseif(X86)
1033
set(PLATFORM_ARCH "Windows/x86")
1034
endif()
1035
endif()
1036
if(WEBOS)
1037
set(PLATFORM_ARCH "linux/webos")
1038
endif()
1039
if(PLATFORM_ARCH)
1040
set(FFMPEG_DIR "ffmpeg/${PLATFORM_ARCH}")
1041
else()
1042
message("Couldn't find an internal FFmpeg build, using system FFmpeg instead")
1043
endif()
1044
endif()
1045
endif()
1046
1047
find_package(FFmpeg REQUIRED avcodec avformat avutil swresample swscale)
1048
# Check if we need to use avcodec_(alloc|free)_frame instead of av_frame_(alloc|free)
1049
# Check if we need to use const AVCodec
1050
set(CMAKE_REQUIRED_INCLUDES ${FFmpeg_INCLUDE_avcodec};${FFmpeg_INCLUDE_avformat})
1051
set(CMAKE_REQUIRED_LIBRARIES FFmpeg::avcodec;FFmpeg::avformat)
1052
set(CMAKE_REQUIRED_FLAGS "-pedantic -Wall -Werror -Wno-unused-variable")
1053
check_cxx_source_compiles("extern \"C\" {
1054
#include <libavcodec/avcodec.h>
1055
#include <libavformat/avformat.h>
1056
}
1057
static AVCodecContext *s_codec_context = NULL;
1058
int main() {
1059
const AVCodec *codec = avcodec_find_encoder(s_codec_context->codec_id);
1060
return 0;
1061
}
1062
" HAVE_LIBAVCODEC_CONST_AVCODEC FAIL_REGEX "invalid conversion")
1063
1064
# Check if we need to use avcodec_alloc_context3 instead of stream->codec
1065
# Check if we need to use av_frame_get_buffer instead of avcodec_default_get_buffer
1066
endif(USE_FFMPEG)
1067
1068
find_package(ZLIB)
1069
if(ZLIB_FOUND AND NOT ANDROID)
1070
include_directories(${ZLIB_INCLUDE_DIR})
1071
add_compile_definitions(SHARED_ZLIB)
1072
else()
1073
add_library(zlib STATIC
1074
ext/zlib/adler32.c
1075
ext/zlib/compress.c
1076
ext/zlib/crc32.c
1077
ext/zlib/crc32.h
1078
ext/zlib/deflate.c
1079
ext/zlib/deflate.h
1080
ext/zlib/gzclose.c
1081
ext/zlib/gzguts.h
1082
ext/zlib/gzlib.c
1083
ext/zlib/gzread.c
1084
ext/zlib/gzwrite.c
1085
ext/zlib/infback.c
1086
ext/zlib/inffast.c
1087
ext/zlib/inffast.h
1088
ext/zlib/inffixed.h
1089
ext/zlib/inflate.c
1090
ext/zlib/inflate.h
1091
ext/zlib/inftrees.c
1092
ext/zlib/inftrees.h
1093
ext/zlib/trees.c
1094
ext/zlib/trees.h
1095
ext/zlib/uncompr.c
1096
ext/zlib/zconf.h
1097
ext/zlib/zlib.h
1098
ext/zlib/zutil.c
1099
ext/zlib/zutil.h
1100
)
1101
include_directories(ext/zlib)
1102
set(ZLIB_LIBRARY zlib)
1103
endif()
1104
1105
add_library(cityhash STATIC
1106
ext/cityhash/city.cpp
1107
ext/cityhash/city.h
1108
ext/cityhash/citycrc.h
1109
)
1110
target_include_directories(cityhash PRIVATE ext/cityhash)
1111
1112
if(NOT MSVC)
1113
# These can be fast even for debug.
1114
target_compile_options(udis86 PRIVATE "-O2")
1115
target_compile_options(cityhash PRIVATE "-O2")
1116
if(NOT ZLIB_FOUND)
1117
target_compile_options(zlib PRIVATE "-O2")
1118
endif()
1119
endif()
1120
1121
1122
find_package(LIBZIP)
1123
if(LIBZIP_FOUND AND USE_SYSTEM_LIBZIP)
1124
include_directories(${LIBZIP_INCLUDE_DIRS})
1125
add_compile_definitions(SHARED_LIBZIP)
1126
else()
1127
add_library(libzip STATIC
1128
ext/libzip/zip_add.c
1129
ext/libzip/zip_add_dir.c
1130
ext/libzip/zip_add_entry.c
1131
ext/libzip/zip_algorithm_deflate.c
1132
ext/libzip/zip_buffer.c
1133
ext/libzip/zip_close.c
1134
ext/libzip/zip_delete.c
1135
ext/libzip/zip_dir_add.c
1136
ext/libzip/zip_dirent.c
1137
ext/libzip/zip_discard.c
1138
ext/libzip/zip_entry.c
1139
ext/libzip/zip_error.c
1140
ext/libzip/zip_error_clear.c
1141
ext/libzip/zip_error_get.c
1142
ext/libzip/zip_error_get_sys_type.c
1143
ext/libzip/zip_error_strerror.c
1144
ext/libzip/zip_error_to_str.c
1145
ext/libzip/zip_extra_field.c
1146
ext/libzip/zip_extra_field_api.c
1147
ext/libzip/zip_fclose.c
1148
ext/libzip/zip_fdopen.c
1149
ext/libzip/zip_file_add.c
1150
ext/libzip/zip_file_error_clear.c
1151
ext/libzip/zip_file_error_get.c
1152
ext/libzip/zip_file_get_comment.c
1153
ext/libzip/zip_file_get_external_attributes.c
1154
ext/libzip/zip_file_get_offset.c
1155
ext/libzip/zip_file_rename.c
1156
ext/libzip/zip_file_replace.c
1157
ext/libzip/zip_file_set_comment.c
1158
ext/libzip/zip_file_set_encryption.c
1159
ext/libzip/zip_file_set_external_attributes.c
1160
ext/libzip/zip_file_set_mtime.c
1161
ext/libzip/zip_file_strerror.c
1162
ext/libzip/zip_fopen.c
1163
ext/libzip/zip_fopen_encrypted.c
1164
ext/libzip/zip_fopen_index.c
1165
ext/libzip/zip_fopen_index_encrypted.c
1166
ext/libzip/zip_fread.c
1167
ext/libzip/zip_fseek.c
1168
ext/libzip/zip_ftell.c
1169
ext/libzip/zip_get_archive_comment.c
1170
ext/libzip/zip_get_archive_flag.c
1171
ext/libzip/zip_get_encryption_implementation.c
1172
ext/libzip/zip_get_file_comment.c
1173
ext/libzip/zip_get_name.c
1174
ext/libzip/zip_get_num_entries.c
1175
ext/libzip/zip_get_num_files.c
1176
ext/libzip/zip_hash.c
1177
ext/libzip/zip_io_util.c
1178
ext/libzip/zip_libzip_version.c
1179
ext/libzip/zip_memdup.c
1180
ext/libzip/zip_name_locate.c
1181
ext/libzip/zip_new.c
1182
ext/libzip/zip_open.c
1183
ext/libzip/zip_pkware.c
1184
ext/libzip/zip_progress.c
1185
ext/libzip/zip_rename.c
1186
ext/libzip/zip_replace.c
1187
ext/libzip/zip_set_archive_comment.c
1188
ext/libzip/zip_set_archive_flag.c
1189
ext/libzip/zip_set_default_password.c
1190
ext/libzip/zip_set_file_comment.c
1191
ext/libzip/zip_set_file_compression.c
1192
ext/libzip/zip_set_name.c
1193
ext/libzip/zip_source_accept_empty.c
1194
ext/libzip/zip_source_begin_write.c
1195
ext/libzip/zip_source_begin_write_cloning.c
1196
ext/libzip/zip_source_buffer.c
1197
ext/libzip/zip_source_call.c
1198
ext/libzip/zip_source_close.c
1199
ext/libzip/zip_source_commit_write.c
1200
ext/libzip/zip_source_compress.c
1201
ext/libzip/zip_source_crc.c
1202
ext/libzip/zip_source_error.c
1203
ext/libzip/zip_source_file_common.c
1204
ext/libzip/zip_source_file_stdio.c
1205
ext/libzip/zip_source_free.c
1206
ext/libzip/zip_source_function.c
1207
ext/libzip/zip_source_get_file_attributes.c
1208
ext/libzip/zip_source_is_deleted.c
1209
ext/libzip/zip_source_layered.c
1210
ext/libzip/zip_source_open.c
1211
ext/libzip/zip_source_pkware_decode.c
1212
ext/libzip/zip_source_pkware_encode.c
1213
ext/libzip/zip_source_read.c
1214
ext/libzip/zip_source_remove.c
1215
ext/libzip/zip_source_rollback_write.c
1216
ext/libzip/zip_source_seek.c
1217
ext/libzip/zip_source_seek_write.c
1218
ext/libzip/zip_source_stat.c
1219
ext/libzip/zip_source_supports.c
1220
ext/libzip/zip_source_tell.c
1221
ext/libzip/zip_source_tell_write.c
1222
ext/libzip/zip_source_window.c
1223
ext/libzip/zip_source_write.c
1224
ext/libzip/zip_source_zip.c
1225
ext/libzip/zip_source_zip_new.c
1226
ext/libzip/zip_stat.c
1227
ext/libzip/zip_stat_index.c
1228
ext/libzip/zip_stat_init.c
1229
ext/libzip/zip_strerror.c
1230
ext/libzip/zip_string.c
1231
ext/libzip/zip_unchange.c
1232
ext/libzip/zip_unchange_all.c
1233
ext/libzip/zip_unchange_archive.c
1234
ext/libzip/zip_unchange_data.c
1235
ext/libzip/zip_utf-8.c
1236
ext/libzip/zip_err_str.c
1237
)
1238
if(WIN32)
1239
target_compile_options(libzip PRIVATE $<$<C_COMPILER_ID:Clang>:-Wno-incompatible-function-pointer-types> $<$<C_COMPILER_ID:GNU>:-Wno-incompatible-pointer-types>)
1240
target_sources(libzip PRIVATE
1241
ext/libzip/zip_source_file_win32.c
1242
ext/libzip/zip_source_file_win32_named.c
1243
ext/libzip/zip_source_file_win32_utf16.c
1244
ext/libzip/zip_source_file_win32_utf8.c
1245
)
1246
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
1247
target_sources(libzip PRIVATE ext/libzip/zip_random_uwp.c)
1248
else()
1249
target_sources(libzip PRIVATE ext/libzip/zip_source_file_win32_ansi.c ext/libzip/zip_random_win32.c)
1250
endif()
1251
else()
1252
target_sources(libzip PRIVATE
1253
ext/libzip/zip_mkstempm.c
1254
ext/libzip/zip_source_file_stdio_named.c
1255
ext/libzip/zip_random_unix.c
1256
)
1257
endif()
1258
target_compile_definitions(libzip PRIVATE HAVE_STDBOOL_H)
1259
target_link_libraries(libzip)
1260
include_directories(ext/libzip)
1261
set(LIBZIP_LIBRARY libzip)
1262
endif()
1263
1264
# Arm platforms require at least libpng17.
1265
if(ANDROID OR ARMV7 OR ARM64 OR ARM OR IOS)
1266
set(PNG_REQUIRED_VERSION 1.7)
1267
else()
1268
set(PNG_REQUIRED_VERSION 1.6)
1269
endif()
1270
1271
if(USE_SYSTEM_LIBPNG)
1272
find_package(PNG ${PNG_REQUIRED_VERSION})
1273
endif()
1274
if(PNG_FOUND)
1275
include_directories(${PNG_INCLUDE_DIRS})
1276
else()
1277
if(ARM)
1278
set(PNG_ARM_INCLUDES
1279
ext/libpng17/arm/arm_init.c
1280
ext/libpng17/arm/filter_neon.S
1281
ext/libpng17/arm/filter_neon_intrinsics.c
1282
)
1283
elseif(ARM64)
1284
set(PNG_ARM_INCLUDES
1285
ext/libpng17/arm/arm_init.c
1286
ext/libpng17/arm/filter_neon_intrinsics.c
1287
)
1288
endif()
1289
add_library(png17 STATIC
1290
ext/libpng17/pngconf.h
1291
ext/libpng17/pngdebug.h
1292
ext/libpng17/png.c
1293
ext/libpng17/png.h
1294
ext/libpng17/pngerror.c
1295
ext/libpng17/pngget.c
1296
ext/libpng17/pnginfo.h
1297
ext/libpng17/pnglibconf.h
1298
ext/libpng17/pngmem.c
1299
ext/libpng17/pngpread.c
1300
ext/libpng17/pngpriv.h
1301
ext/libpng17/pngread.c
1302
ext/libpng17/pngrio.c
1303
ext/libpng17/pngrtran.c
1304
ext/libpng17/pngrutil.c
1305
ext/libpng17/pngset.c
1306
ext/libpng17/pngstruct.h
1307
ext/libpng17/pngtrans.c
1308
ext/libpng17/pngwio.c
1309
ext/libpng17/pngwrite.c
1310
ext/libpng17/pngwtran.c
1311
ext/libpng17/pngwutil.c
1312
${PNG_ARM_INCLUDES}
1313
)
1314
set(PNG_LIBRARIES png17)
1315
include_directories(ext/libpng17)
1316
endif()
1317
1318
add_library(basis_universal STATIC
1319
ext/basis_universal/basisu.h
1320
ext/basis_universal/basisu_containers.h
1321
ext/basis_universal/basisu_containers_impl.h
1322
ext/basis_universal/basisu_file_headers.h
1323
ext/basis_universal/basisu_transcoder.cpp
1324
ext/basis_universal/basisu_transcoder.h
1325
ext/basis_universal/basisu_transcoder_internal.h
1326
ext/basis_universal/basisu_transcoder_tables_astc.inc
1327
ext/basis_universal/basisu_transcoder_tables_astc_0_255.inc
1328
ext/basis_universal/basisu_transcoder_tables_atc_55.inc
1329
ext/basis_universal/basisu_transcoder_tables_atc_56.inc
1330
ext/basis_universal/basisu_transcoder_tables_bc7_m5_alpha.inc
1331
ext/basis_universal/basisu_transcoder_tables_bc7_m5_color.inc
1332
ext/basis_universal/basisu_transcoder_tables_dxt1_5.inc
1333
ext/basis_universal/basisu_transcoder_tables_dxt1_6.inc
1334
ext/basis_universal/basisu_transcoder_tables_pvrtc2_45.inc
1335
ext/basis_universal/basisu_transcoder_tables_pvrtc2_alpha_33.inc
1336
ext/basis_universal/basisu_transcoder_uastc.h
1337
)
1338
set(BASISU_LIBRARIES basis_universal)
1339
1340
set(nativeExtra)
1341
set(nativeExtraLibs)
1342
1343
if(OPENXR AND NOT ARMV7_DEVICE)
1344
list(APPEND nativeExtraLibs openxr_loader)
1345
endif()
1346
1347
if(IOS OR MACOSX)
1348
list(APPEND nativeExtra
1349
Common/Render/Text/draw_text_cocoa.mm
1350
Common/Render/Text/draw_text_cocoa.h)
1351
endif()
1352
1353
if(ANDROID)
1354
list(APPEND NativeAppSource
1355
android/jni/app-android.cpp
1356
android/jni/AndroidJavaGLContext.cpp
1357
android/jni/AndroidJavaGLContext.h
1358
android/jni/AndroidVulkanContext.cpp
1359
android/jni/AndroidVulkanContext.h
1360
android/jni/AndroidGraphicsContext.h
1361
android/jni/AndroidAudio.cpp
1362
android/jni/AndroidAudio.h
1363
android/jni/OpenSLContext.cpp
1364
android/jni/OpenSLContext.h
1365
)
1366
# No target
1367
elseif(IOS AND NOT LIBRETRO)
1368
list(APPEND nativeExtra
1369
ios/main.mm
1370
ios/AppDelegate.mm
1371
ios/AppDelegate.h
1372
ios/SceneDelegate.mm
1373
ios/SceneDelegate.h
1374
ios/DisplayManager.h
1375
ios/DisplayManager.mm
1376
ios/Controls.h
1377
ios/Controls.mm
1378
ios/ViewControllerCommon.h
1379
ios/ViewControllerCommon.mm
1380
ios/ViewController.mm
1381
ios/ViewController.h
1382
ios/ViewControllerMetal.mm
1383
ios/ViewControllerMetal.h
1384
ios/iOSCoreAudio.mm
1385
ios/iOSCoreAudio.h
1386
ios/IAPManager.mm
1387
ios/IAPManager.h
1388
ios/CameraHelper.mm
1389
ios/CameraHelper.h
1390
ios/LocationHelper.mm
1391
ios/LocationHelper.h
1392
ios/PPSSPPUIApplication.h
1393
ios/PPSSPPUIApplication.mm
1394
ios/SmartKeyboardMap.cpp
1395
ios/SmartKeyboardMap.hpp
1396
ios/iCade/iCadeReaderView.h
1397
ios/iCade/iCadeReaderView.m
1398
ios/iCade/iCadeState.h
1399
UI/DarwinFileSystemServices.mm
1400
UI/DarwinFileSystemServices.h
1401
Common/Battery/AppleBatteryClient.m
1402
)
1403
1404
list(APPEND nativeExtraLibs "-framework Foundation -framework MediaPlayer -framework AudioToolbox -framework CoreGraphics -framework CoreMotion -framework QuartzCore -framework UIKit -framework GLKit -framework OpenAL -framework AVFoundation -framework CoreLocation -framework CoreText -framework CoreVideo -framework CoreMedia -framework CoreServices -framework Metal -framework IOSurface" )
1405
if(EXISTS "${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks/GameController.framework")
1406
list(APPEND nativeExtraLibs "-weak_framework GameController")
1407
endif()
1408
1409
if(NOT ICONV_LIBRARY)
1410
list(APPEND nativeExtraLibs iconv)
1411
endif()
1412
1413
# TODO: Enable arc globally?
1414
set_source_files_properties(ios/AppDelegate.mm
1415
ios/ViewController.mm
1416
ios/ViewControllerMetal.mm
1417
ios/iOSCoreAudio.mm
1418
ios/PPSSPPUIApplication.mm
1419
ios/iCade/iCadeReaderView.m
1420
ios/main.mm
1421
ios/CameraHelper.mm
1422
ios/AudioEngine.mm
1423
ios/LocationHelper.mm
1424
ios/DisplayManager.mm
1425
ios/Controls.mm
1426
UI/DarwinFileSystemServices.mm
1427
Common/Battery/AppleBatteryClient.m
1428
Common/Render/Text/draw_text_cocoa.mm
1429
PROPERTIES COMPILE_FLAGS -fobjc-arc)
1430
1431
set(TargetBin PPSSPP)
1432
elseif(IOS AND LIBRETRO)
1433
list(APPEND nativeExtraLibs "-framework GLKit")
1434
elseif(USING_QT_UI)
1435
set(CMAKE_AUTOMOC ON)
1436
find_package(Qt5 COMPONENTS OpenGL Gui Core Multimedia)
1437
list(APPEND NativeAppSource
1438
Qt/QtMain.cpp
1439
Qt/QtMain.h
1440
Qt/mainwindow.cpp
1441
Qt/mainwindow.h
1442
)
1443
add_compile_definitions(USING_QT_UI)
1444
if(USING_GLES2)
1445
add_compile_definitions(QT_OPENGL_ES QT_OPENGL_ES_2)
1446
endif()
1447
if(APPLE)
1448
list(APPEND NativeAppSource
1449
UI/DarwinFileSystemServices.mm
1450
UI/DarwinFileSystemServices.h
1451
Common/Battery/AppleBatteryClient.m)
1452
set_source_files_properties(Common/Battery/AppleBatteryClient.m
1453
UI/DarwinFileSystemServices.mm
1454
Common/Render/Text/draw_text_cocoa.mm
1455
PROPERTIES COMPILE_FLAGS -fobjc-arc)
1456
list(APPEND nativeExtraLibs ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY})
1457
endif()
1458
include_directories(Qt)
1459
include_directories(${CMAKE_CURRENT_BINARY_DIR})
1460
list(APPEND nativeExtraLibs Qt5::OpenGL Qt5::Gui Qt5::Core Qt5::Multimedia)
1461
set(TargetBin PPSSPPQt)
1462
1463
# Enable SDL joystick if SDL is found
1464
if(SDL2_FOUND)
1465
add_compile_definitions(SDL)
1466
list(APPEND nativeExtra
1467
SDL/SDLJoystick.h
1468
SDL/SDLJoystick.cpp
1469
)
1470
list(APPEND nativeExtraLibs SDL2::SDL2)
1471
endif()
1472
1473
elseif(WIN32)
1474
# Don't care about SDL.
1475
set(TargetBin PPSSPPWindows)
1476
elseif(LIBRETRO)
1477
else()
1478
if(GOLD)
1479
set(TargetBin PPSSPPGold)
1480
else()
1481
set(TargetBin PPSSPPSDL)
1482
endif()
1483
# Require SDL
1484
add_compile_definitions(SDL)
1485
list(APPEND nativeExtra
1486
SDL/SDLJoystick.h
1487
SDL/SDLJoystick.cpp
1488
SDL/SDLMain.cpp
1489
SDL/SDLGLGraphicsContext.cpp
1490
)
1491
if(NOT USE_LIBNX)
1492
list(APPEND nativeExtra
1493
SDL/SDLVulkanGraphicsContext.cpp
1494
)
1495
endif()
1496
if(SDL2_ttf_FOUND OR
1497
(SDL2_ttf_PKGCONFIG_FOUND AND
1498
SDL2_ttf_PKGCONFIG_VERSION VERSION_GREATER_EQUAL "2.0.18"))
1499
add_compile_definitions(USE_SDL2_TTF)
1500
if(FONTCONFIG_FOUND)
1501
add_compile_definitions(USE_SDL2_TTF_FONTCONFIG)
1502
list(APPEND nativeExtraLibs Fontconfig::Fontconfig)
1503
endif()
1504
elseif(SDL2_ttf_PKGCONFIG_FOUND)
1505
message(WARNING "Found SDL2_ttf <2.0.18 - this is too old, falling back to atlas")
1506
endif()
1507
if(SDL2_ttf_FOUND)
1508
list(APPEND nativeExtraLibs SDL2_ttf::SDL2_ttf)
1509
elseif(SDL2_ttf_PKGCONFIG_FOUND)
1510
list(APPEND nativeExtraLibs PkgConfig::SDL2_ttf_PKGCONFIG)
1511
endif()
1512
if(APPLE)
1513
list(APPEND nativeExtra
1514
SDL/SDLMain.h
1515
SDL/SDLMain.mm
1516
SDL/SDLCocoaMetalLayer.h
1517
SDL/SDLCocoaMetalLayer.mm
1518
SDL/CocoaBarItems.mm
1519
SDL/CocoaBarItems.h
1520
SDL/PPSSPPAboutViewController.m
1521
SDL/PPSSPPAboutViewController.h
1522
SDL/MacCameraHelper.mm
1523
UI/DarwinFileSystemServices.mm
1524
UI/DarwinFileSystemServices.h
1525
Common/Battery/AppleBatteryClient.m
1526
UI/PSPNSApplicationDelegate.mm
1527
UI/PSPNSApplicationDelegate.h)
1528
1529
# TODO
1530
# set_source_files_properties(SDL/SDLMain.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
1531
1532
set_source_files_properties(UI/DarwinFileSystemServices.mm
1533
UI/PSPNSApplicationDelegate.mm
1534
SDL/CocoaMetalLayer.mm
1535
SDL/CocoaBarItems.mm
1536
SDL/PPSSPPAboutViewController.m
1537
SDL/MacCameraHelper.mm
1538
Common/Battery/AppleBatteryClient.m
1539
Common/Render/Text/draw_text_cocoa.mm
1540
PROPERTIES COMPILE_FLAGS -fobjc-arc)
1541
list(APPEND nativeExtraLibs ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY} "-framework AVFoundation" "-framework CoreMedia" "-framework CoreVideo")
1542
1543
if(USE_SYSTEM_LIBSDL2)
1544
list(APPEND nativeExtraLibs SDL2::SDL2)
1545
else()
1546
list(APPEND nativeExtraLibs ${SDL2Fwk})
1547
endif()
1548
elseif(USING_EGL)
1549
list(APPEND nativeExtraLibs pthread SDL2::SDL2)
1550
else()
1551
list(APPEND nativeExtraLibs SDL2::SDL2)
1552
endif()
1553
endif()
1554
1555
if(WIN32)
1556
target_link_libraries(Common winmm dsound dxguid Version)
1557
endif()
1558
1559
if(NOT LIBRETRO)
1560
list(APPEND NativeAppSource
1561
UI/AudioCommon.h
1562
UI/AudioCommon.cpp
1563
)
1564
endif()
1565
1566
list(APPEND NativeAppSource
1567
UI/ImDebugger/ImDebugger.cpp
1568
UI/ImDebugger/ImDebugger.h
1569
UI/ImDebugger/ImGe.cpp
1570
UI/ImDebugger/ImGe.h
1571
UI/ImDebugger/ImConsole.cpp
1572
UI/ImDebugger/ImConsole.h
1573
UI/ImDebugger/ImDisasmView.cpp
1574
UI/ImDebugger/ImDisasmView.h
1575
UI/ImDebugger/ImMemView.cpp
1576
UI/ImDebugger/ImMemView.h
1577
UI/ImDebugger/ImStructViewer.cpp
1578
UI/ImDebugger/ImStructViewer.h
1579
UI/ImDebugger/ImJitViewer.cpp
1580
UI/ImDebugger/ImJitViewer.h
1581
UI/DiscordIntegration.cpp
1582
UI/NativeApp.cpp
1583
UI/BackgroundAudio.h
1584
UI/BackgroundAudio.cpp
1585
UI/Background.h
1586
UI/Background.cpp
1587
UI/ChatScreen.h
1588
UI/ChatScreen.cpp
1589
UI/BaseScreens.h
1590
UI/BaseScreens.cpp
1591
UI/DebugOverlay.cpp
1592
UI/DebugOverlay.h
1593
UI/DevScreens.cpp
1594
UI/DevScreens.h
1595
UI/DisplayLayoutScreen.cpp
1596
UI/DisplayLayoutScreen.h
1597
UI/EmuScreen.h
1598
UI/EmuScreen.cpp
1599
UI/GameInfoCache.h
1600
UI/GameInfoCache.cpp
1601
UI/IAPScreen.cpp
1602
UI/IAPScreen.h
1603
UI/MainScreen.h
1604
UI/MainScreen.cpp
1605
UI/MiscScreens.h
1606
UI/MiscScreens.cpp
1607
UI/MiscViews.h
1608
UI/MiscViews.cpp
1609
UI/PauseScreen.h
1610
UI/PauseScreen.cpp
1611
UI/SimpleDialogScreen.h
1612
UI/SimpleDialogScreen.cpp
1613
UI/TabbedDialogScreen.h
1614
UI/TabbedDialogScreen.cpp
1615
UI/GameScreen.h
1616
UI/GameScreen.cpp
1617
UI/GameSettingsScreen.h
1618
UI/GameSettingsScreen.cpp
1619
UI/DeveloperToolsScreen.h
1620
UI/DeveloperToolsScreen.cpp
1621
UI/DriverManagerScreen.h
1622
UI/DriverManagerScreen.cpp
1623
UI/GPUDriverTestScreen.h
1624
UI/GPUDriverTestScreen.cpp
1625
UI/TiltAnalogSettingsScreen.h
1626
UI/TiltAnalogSettingsScreen.cpp
1627
UI/TouchControlLayoutScreen.h
1628
UI/TouchControlLayoutScreen.cpp
1629
UI/TouchControlVisibilityScreen.h
1630
UI/TouchControlVisibilityScreen.cpp
1631
UI/GamepadEmu.h
1632
UI/GamepadEmu.cpp
1633
UI/JoystickHistoryView.h
1634
UI/JoystickHistoryView.cpp
1635
UI/OnScreenDisplay.h
1636
UI/OnScreenDisplay.cpp
1637
UI/ControlMappingScreen.h
1638
UI/ControlMappingScreen.cpp
1639
UI/RemoteISOScreen.h
1640
UI/RemoteISOScreen.cpp
1641
UI/ReportScreen.h
1642
UI/ReportScreen.cpp
1643
UI/SavedataScreen.h
1644
UI/SavedataScreen.cpp
1645
UI/SystemInfoScreen.h
1646
UI/SystemInfoScreen.cpp
1647
UI/Store.h
1648
UI/Store.cpp
1649
UI/UploadScreen.h
1650
UI/UploadScreen.cpp
1651
UI/CwCheatScreen.h
1652
UI/CwCheatScreen.cpp
1653
UI/InstallZipScreen.h
1654
UI/InstallZipScreen.cpp
1655
UI/JitCompareScreen.h
1656
UI/JitCompareScreen.cpp
1657
UI/MemStickScreen.h
1658
UI/MemStickScreen.cpp
1659
UI/ProfilerDraw.h
1660
UI/ProfilerDraw.cpp
1661
UI/CustomButtonMappingScreen.h
1662
UI/CustomButtonMappingScreen.cpp
1663
UI/Theme.h
1664
UI/Theme.cpp
1665
UI/UIAtlas.h
1666
UI/UIAtlas.cpp
1667
UI/RetroAchievementScreens.cpp
1668
UI/RetroAchievementScreens.h
1669
)
1670
1671
if(ANDROID)
1672
if(ARM)
1673
list(APPEND NativeAppSource android/jni/ArmEmitterTest.cpp)
1674
elseif(ARM64)
1675
list(APPEND NativeAppSource android/jni/Arm64EmitterTest.cpp)
1676
endif()
1677
1678
if (NOT LIBRETRO)
1679
list(APPEND nativeExtra ${NativeAppSource})
1680
endif()
1681
endif()
1682
1683
if (IOS AND NOT LIBRETRO)
1684
list(APPEND nativeExtra ${NativeAppSource})
1685
endif()
1686
1687
add_library(native STATIC
1688
${nativeExtra}
1689
Common/Render/Text/draw_text_qt.cpp
1690
Common/Render/Text/draw_text_qt.h
1691
ext/jpge/jpgd.cpp
1692
ext/jpge/jpgd.h
1693
ext/jpge/jpge.cpp
1694
ext/jpge/jpge.h
1695
)
1696
1697
if(LIBRETRO)
1698
target_include_directories(native PRIVATE libretro/libretro-common/include)
1699
endif()
1700
1701
if(LINUX AND NOT ANDROID)
1702
set(RT_LIB rt)
1703
endif()
1704
1705
set(ATOMIC_LIB)
1706
if(ANDROID OR (LINUX AND ARM_DEVICE) OR (LINUX AND RISCV64) OR (LINUX AND LOONGARCH64))
1707
set(ATOMIC_LIB atomic)
1708
endif()
1709
1710
target_link_libraries(native ${LIBZIP_LIBRARY} ${PNG_LIBRARIES} ${BASISU_LIBRARIES} ${ZLIB_LIBRARY} vma gason udis86 ${RT_LIB} ${nativeExtraLibs} ${ATOMIC_LIB} Common)
1711
if(TARGET Ext::GLEW)
1712
target_link_libraries(native Ext::GLEW)
1713
endif()
1714
1715
if(ANDROID)
1716
target_link_libraries(native log EGL OpenSLES)
1717
elseif(WIN32)
1718
target_link_libraries(native ws2_32 winmm)
1719
elseif(${CMAKE_SYSTEM_NAME} MATCHES "^(DragonFly|FreeBSD|NetBSD)$")
1720
target_link_libraries(native execinfo)
1721
endif()
1722
1723
add_library(kirk STATIC
1724
ext/libkirk/AES.c
1725
ext/libkirk/AES.h
1726
ext/libkirk/amctrl.c
1727
ext/libkirk/amctrl.h
1728
ext/libkirk/SHA1.c
1729
ext/libkirk/SHA1.h
1730
ext/libkirk/bn.c
1731
ext/libkirk/ec.c
1732
ext/libkirk/kirk_engine.c
1733
ext/libkirk/kirk_engine.h
1734
ext/libkirk/kirk_common.h
1735
)
1736
target_include_directories(kirk PRIVATE ext/libkirk)
1737
1738
add_library(sfmt19937 STATIC
1739
ext/sfmt19937/SFMT.c
1740
ext/sfmt19937/SFMT.h
1741
ext/sfmt19937/SFMT-common.h
1742
ext/sfmt19937/SFMT-params.h
1743
ext/sfmt19937/SFMT-params19937.h
1744
)
1745
target_compile_definitions(sfmt19937 PRIVATE SFMT_MEXP=19937)
1746
target_include_directories(sfmt19937 PRIVATE ext/sfmt19937)
1747
1748
add_library(xbrz STATIC
1749
ext/xbrz/xbrz.cpp
1750
ext/xbrz/xbrz.h
1751
)
1752
target_include_directories(xbrz PRIVATE ext/xbrz)
1753
1754
add_library(xxhash STATIC
1755
ext/xxhash.c
1756
ext/xxhash.h
1757
)
1758
target_include_directories(xxhash PRIVATE ext/xxhash)
1759
1760
set(CoreExtra)
1761
set(CoreExtraLibs)
1762
1763
list(APPEND CoreExtra
1764
Core/MIPS/IR/IRAnalysis.cpp
1765
Core/MIPS/IR/IRAnalysis.h
1766
Core/MIPS/IR/IRCompALU.cpp
1767
Core/MIPS/IR/IRCompBranch.cpp
1768
Core/MIPS/IR/IRCompFPU.cpp
1769
Core/MIPS/IR/IRCompLoadStore.cpp
1770
Core/MIPS/IR/IRCompVFPU.cpp
1771
Core/MIPS/IR/IRFrontend.cpp
1772
Core/MIPS/IR/IRFrontend.h
1773
Core/MIPS/IR/IRInst.cpp
1774
Core/MIPS/IR/IRInst.h
1775
Core/MIPS/IR/IRInterpreter.cpp
1776
Core/MIPS/IR/IRInterpreter.h
1777
Core/MIPS/IR/IRJit.cpp
1778
Core/MIPS/IR/IRJit.h
1779
Core/MIPS/IR/IRNativeCommon.cpp
1780
Core/MIPS/IR/IRNativeCommon.h
1781
Core/MIPS/IR/IRPassSimplify.cpp
1782
Core/MIPS/IR/IRPassSimplify.h
1783
Core/MIPS/IR/IRRegCache.cpp
1784
Core/MIPS/IR/IRRegCache.h
1785
)
1786
1787
list(APPEND CoreExtra
1788
Core/MIPS/ARM/ArmAsm.cpp
1789
Core/MIPS/ARM/ArmCompALU.cpp
1790
Core/MIPS/ARM/ArmCompBranch.cpp
1791
Core/MIPS/ARM/ArmCompFPU.cpp
1792
Core/MIPS/ARM/ArmCompLoadStore.cpp
1793
Core/MIPS/ARM/ArmCompVFPU.cpp
1794
Core/MIPS/ARM/ArmCompReplace.cpp
1795
Core/MIPS/ARM/ArmJit.cpp
1796
Core/MIPS/ARM/ArmJit.h
1797
Core/MIPS/ARM/ArmRegCache.cpp
1798
Core/MIPS/ARM/ArmRegCache.h
1799
Core/MIPS/ARM/ArmRegCacheFPU.cpp
1800
Core/MIPS/ARM/ArmRegCacheFPU.h
1801
GPU/Common/VertexDecoderArm.cpp
1802
)
1803
1804
list(APPEND CoreExtra
1805
Core/MIPS/ARM64/Arm64Asm.cpp
1806
Core/MIPS/ARM64/Arm64CompALU.cpp
1807
Core/MIPS/ARM64/Arm64CompBranch.cpp
1808
Core/MIPS/ARM64/Arm64CompFPU.cpp
1809
Core/MIPS/ARM64/Arm64CompLoadStore.cpp
1810
Core/MIPS/ARM64/Arm64CompVFPU.cpp
1811
Core/MIPS/ARM64/Arm64CompReplace.cpp
1812
Core/MIPS/ARM64/Arm64Jit.cpp
1813
Core/MIPS/ARM64/Arm64Jit.h
1814
Core/MIPS/ARM64/Arm64RegCache.cpp
1815
Core/MIPS/ARM64/Arm64RegCache.h
1816
Core/MIPS/ARM64/Arm64RegCacheFPU.cpp
1817
Core/MIPS/ARM64/Arm64RegCacheFPU.h
1818
Core/MIPS/ARM64/Arm64IRAsm.cpp
1819
Core/MIPS/ARM64/Arm64IRCompALU.cpp
1820
Core/MIPS/ARM64/Arm64IRCompBranch.cpp
1821
Core/MIPS/ARM64/Arm64IRCompFPU.cpp
1822
Core/MIPS/ARM64/Arm64IRCompLoadStore.cpp
1823
Core/MIPS/ARM64/Arm64IRCompSystem.cpp
1824
Core/MIPS/ARM64/Arm64IRCompVec.cpp
1825
Core/MIPS/ARM64/Arm64IRJit.cpp
1826
Core/MIPS/ARM64/Arm64IRJit.h
1827
Core/MIPS/ARM64/Arm64IRRegCache.cpp
1828
Core/MIPS/ARM64/Arm64IRRegCache.h
1829
GPU/Common/VertexDecoderArm64.cpp
1830
Core/Util/DisArm64.cpp
1831
)
1832
1833
list(APPEND CoreExtra
1834
Core/MIPS/x86/Asm.cpp
1835
Core/MIPS/x86/CompALU.cpp
1836
Core/MIPS/x86/CompBranch.cpp
1837
Core/MIPS/x86/CompFPU.cpp
1838
Core/MIPS/x86/CompLoadStore.cpp
1839
Core/MIPS/x86/CompVFPU.cpp
1840
Core/MIPS/x86/CompReplace.cpp
1841
Core/MIPS/x86/Jit.cpp
1842
Core/MIPS/x86/Jit.h
1843
Core/MIPS/x86/JitSafeMem.cpp
1844
Core/MIPS/x86/JitSafeMem.h
1845
Core/MIPS/x86/RegCache.cpp
1846
Core/MIPS/x86/RegCache.h
1847
Core/MIPS/x86/RegCacheFPU.cpp
1848
Core/MIPS/x86/RegCacheFPU.h
1849
Core/MIPS/x86/X64IRAsm.cpp
1850
Core/MIPS/x86/X64IRCompALU.cpp
1851
Core/MIPS/x86/X64IRCompBranch.cpp
1852
Core/MIPS/x86/X64IRCompFPU.cpp
1853
Core/MIPS/x86/X64IRCompLoadStore.cpp
1854
Core/MIPS/x86/X64IRCompSystem.cpp
1855
Core/MIPS/x86/X64IRCompVec.cpp
1856
Core/MIPS/x86/X64IRJit.cpp
1857
Core/MIPS/x86/X64IRJit.h
1858
Core/MIPS/x86/X64IRRegCache.cpp
1859
Core/MIPS/x86/X64IRRegCache.h
1860
GPU/Common/VertexDecoderX86.cpp
1861
GPU/Software/DrawPixelX86.cpp
1862
GPU/Software/SamplerX86.cpp
1863
)
1864
1865
list(APPEND CoreExtra
1866
Core/MIPS/MIPS/MipsJit.cpp
1867
Core/MIPS/MIPS/MipsJit.h
1868
)
1869
1870
list(APPEND CoreExtra
1871
Core/MIPS/RiscV/RiscVAsm.cpp
1872
Core/MIPS/RiscV/RiscVCompALU.cpp
1873
Core/MIPS/RiscV/RiscVCompBranch.cpp
1874
Core/MIPS/RiscV/RiscVCompFPU.cpp
1875
Core/MIPS/RiscV/RiscVCompLoadStore.cpp
1876
Core/MIPS/RiscV/RiscVCompSystem.cpp
1877
Core/MIPS/RiscV/RiscVCompVec.cpp
1878
Core/MIPS/RiscV/RiscVJit.cpp
1879
Core/MIPS/RiscV/RiscVJit.h
1880
Core/MIPS/RiscV/RiscVRegCache.cpp
1881
Core/MIPS/RiscV/RiscVRegCache.h
1882
GPU/Common/VertexDecoderRiscV.cpp
1883
)
1884
1885
list(APPEND CoreExtra
1886
Core/MIPS/LoongArch64/LoongArch64Asm.cpp
1887
Core/MIPS/LoongArch64/LoongArch64CompALU.cpp
1888
Core/MIPS/LoongArch64/LoongArch64CompBranch.cpp
1889
Core/MIPS/LoongArch64/LoongArch64CompFPU.cpp
1890
Core/MIPS/LoongArch64/LoongArch64CompLoadStore.cpp
1891
Core/MIPS/LoongArch64/LoongArch64CompSystem.cpp
1892
Core/MIPS/LoongArch64/LoongArch64CompVec.cpp
1893
Core/MIPS/LoongArch64/LoongArch64Jit.cpp
1894
Core/MIPS/LoongArch64/LoongArch64Jit.h
1895
Core/MIPS/LoongArch64/LoongArch64RegCache.cpp
1896
Core/MIPS/LoongArch64/LoongArch64RegCache.h
1897
GPU/Common/VertexDecoderLoongArch64.cpp
1898
)
1899
1900
if(NOT MOBILE_DEVICE)
1901
list(APPEND CoreExtra
1902
Core/AVIDump.cpp
1903
Core/AVIDump.h
1904
Core/WaveFile.cpp
1905
Core/WaveFile.h
1906
)
1907
endif()
1908
1909
set(GPU_GLES
1910
GPU/GLES/StencilBufferGLES.cpp
1911
GPU/GLES/GPU_GLES.cpp
1912
GPU/GLES/GPU_GLES.h
1913
GPU/GLES/FragmentTestCacheGLES.cpp
1914
GPU/GLES/FragmentTestCacheGLES.h
1915
GPU/GLES/FramebufferManagerGLES.cpp
1916
GPU/GLES/FramebufferManagerGLES.h
1917
GPU/GLES/ShaderManagerGLES.cpp
1918
GPU/GLES/ShaderManagerGLES.h
1919
GPU/GLES/StateMappingGLES.cpp
1920
GPU/GLES/StateMappingGLES.h
1921
GPU/GLES/TextureCacheGLES.cpp
1922
GPU/GLES/TextureCacheGLES.h
1923
GPU/GLES/DrawEngineGLES.cpp
1924
GPU/GLES/DrawEngineGLES.h
1925
)
1926
1927
set(GPU_VULKAN
1928
GPU/Vulkan/DebugVisVulkan.cpp
1929
GPU/Vulkan/DebugVisVulkan.h
1930
GPU/Vulkan/DrawEngineVulkan.cpp
1931
GPU/Vulkan/DrawEngineVulkan.h
1932
GPU/Vulkan/FramebufferManagerVulkan.cpp
1933
GPU/Vulkan/FramebufferManagerVulkan.h
1934
GPU/Vulkan/GPU_Vulkan.cpp
1935
GPU/Vulkan/GPU_Vulkan.h
1936
GPU/Vulkan/PipelineManagerVulkan.cpp
1937
GPU/Vulkan/PipelineManagerVulkan.h
1938
GPU/Vulkan/ShaderManagerVulkan.cpp
1939
GPU/Vulkan/ShaderManagerVulkan.h
1940
GPU/Vulkan/StateMappingVulkan.cpp
1941
GPU/Vulkan/StateMappingVulkan.h
1942
GPU/Vulkan/TextureCacheVulkan.cpp
1943
GPU/Vulkan/TextureCacheVulkan.h
1944
GPU/Vulkan/VulkanUtil.cpp
1945
GPU/Vulkan/VulkanUtil.h
1946
)
1947
1948
set(GPU_D3D11
1949
GPU/D3D11/DrawEngineD3D11.cpp
1950
GPU/D3D11/DrawEngineD3D11.h
1951
GPU/D3D11/FramebufferManagerD3D11.cpp
1952
GPU/D3D11/FramebufferManagerD3D11.h
1953
GPU/D3D11/GPU_D3D11.cpp
1954
GPU/D3D11/GPU_D3D11.h
1955
GPU/D3D11/D3D11Util.cpp
1956
GPU/D3D11/D3D11Util.h
1957
GPU/D3D11/ShaderManagerD3D11.cpp
1958
GPU/D3D11/ShaderManagerD3D11.h
1959
GPU/D3D11/StateMappingD3D11.cpp
1960
GPU/D3D11/StateMappingD3D11.h
1961
GPU/D3D11/TextureCacheD3D11.cpp
1962
GPU/D3D11/TextureCacheD3D11.h
1963
)
1964
1965
# We build Vulkan even on Apple to avoid annoying build differences.
1966
set(GPU_IMPLS ${GPU_GLES} ${GPU_VULKAN})
1967
if(WIN32)
1968
list(APPEND GPU_IMPLS ${GPU_D3D11})
1969
endif()
1970
1971
set(GPU_SOURCES
1972
${GPU_IMPLS}
1973
${GPU_NEON}
1974
GPU/Common/Draw2D.cpp
1975
GPU/Common/Draw2D.h
1976
GPU/Common/DepthBufferCommon.cpp
1977
GPU/Common/DepthRaster.cpp
1978
GPU/Common/DepthRaster.h
1979
GPU/Common/TextureShaderCommon.cpp
1980
GPU/Common/TextureShaderCommon.h
1981
GPU/Common/DepalettizeShaderCommon.cpp
1982
GPU/Common/DepalettizeShaderCommon.h
1983
GPU/Common/FragmentShaderGenerator.cpp
1984
GPU/Common/FragmentShaderGenerator.h
1985
GPU/Common/VertexShaderGenerator.cpp
1986
GPU/Common/VertexShaderGenerator.h
1987
GPU/Common/GeometryShaderGenerator.cpp
1988
GPU/Common/GeometryShaderGenerator.h
1989
GPU/Common/FramebufferManagerCommon.cpp
1990
GPU/Common/FramebufferManagerCommon.h
1991
GPU/Common/GPUDebugInterface.cpp
1992
GPU/Common/GPUDebugInterface.h
1993
GPU/Common/GPUStateUtils.cpp
1994
GPU/Common/GPUStateUtils.h
1995
GPU/Common/DrawEngineCommon.cpp
1996
GPU/Common/DrawEngineCommon.h
1997
GPU/Common/PresentationCommon.cpp
1998
GPU/Common/PresentationCommon.h
1999
GPU/Common/ReinterpretFramebuffer.cpp
2000
GPU/Common/ReinterpretFramebuffer.h
2001
GPU/Common/ShaderId.cpp
2002
GPU/Common/ShaderId.h
2003
GPU/Common/ShaderUniforms.cpp
2004
GPU/Common/ShaderUniforms.h
2005
GPU/Common/ShaderCommon.cpp
2006
GPU/Common/ShaderCommon.h
2007
GPU/Common/SplineCommon.cpp
2008
GPU/Common/SplineCommon.h
2009
GPU/Common/StencilCommon.cpp
2010
GPU/Common/StencilCommon.h
2011
GPU/Common/SoftwareTransformCommon.cpp
2012
GPU/Common/SoftwareTransformCommon.h
2013
GPU/Common/VertexDecoderCommon.cpp
2014
GPU/Common/VertexDecoderCommon.h
2015
GPU/Common/VertexDecoderHandwritten.cpp
2016
GPU/Common/VertexDecoderHandwritten.h
2017
GPU/Common/TransformCommon.cpp
2018
GPU/Common/TransformCommon.h
2019
GPU/Common/IndexGenerator.cpp
2020
GPU/Common/IndexGenerator.h
2021
GPU/Common/TextureDecoder.cpp
2022
GPU/Common/TextureDecoder.h
2023
GPU/Common/TextureCacheCommon.cpp
2024
GPU/Common/TextureCacheCommon.h
2025
GPU/Common/TextureScalerCommon.cpp
2026
GPU/Common/TextureScalerCommon.h
2027
GPU/Common/PostShader.cpp
2028
GPU/Common/PostShader.h
2029
GPU/Common/TextureReplacer.cpp
2030
GPU/Common/TextureReplacer.h
2031
GPU/Common/ReplacedTexture.cpp
2032
GPU/Common/ReplacedTexture.h
2033
GPU/Debugger/Breakpoints.cpp
2034
GPU/Debugger/Breakpoints.h
2035
GPU/Debugger/Debugger.cpp
2036
GPU/Debugger/Debugger.h
2037
GPU/Debugger/GECommandTable.cpp
2038
GPU/Debugger/GECommandTable.h
2039
GPU/Debugger/Playback.cpp
2040
GPU/Debugger/Playback.h
2041
GPU/Debugger/Record.cpp
2042
GPU/Debugger/Record.h
2043
GPU/Debugger/RecordFormat.h
2044
GPU/Debugger/State.cpp
2045
GPU/Debugger/State.h
2046
GPU/Debugger/Stepping.cpp
2047
GPU/Debugger/Stepping.h
2048
GPU/ge_constants.h
2049
GPU/GeConstants.cpp
2050
GPU/GPUDefinitions.h
2051
GPU/GeDisasm.cpp
2052
GPU/GeDisasm.h
2053
GPU/GPU.cpp
2054
GPU/GPU.h
2055
GPU/GPUCommon.cpp
2056
GPU/GPUCommon.h
2057
GPU/GPUCommonHW.cpp
2058
GPU/GPUCommonHW.h
2059
GPU/GPUState.cpp
2060
GPU/GPUState.h
2061
GPU/Math3D.cpp
2062
GPU/Math3D.h
2063
GPU/Software/BinManager.cpp
2064
GPU/Software/BinManager.h
2065
GPU/Software/Clipper.cpp
2066
GPU/Software/Clipper.h
2067
GPU/Software/DrawPixel.cpp
2068
GPU/Software/DrawPixel.h
2069
GPU/Software/FuncId.cpp
2070
GPU/Software/FuncId.h
2071
GPU/Software/Lighting.cpp
2072
GPU/Software/Lighting.h
2073
GPU/Software/Rasterizer.cpp
2074
GPU/Software/Rasterizer.h
2075
GPU/Software/RasterizerRectangle.cpp
2076
GPU/Software/RasterizerRectangle.h
2077
GPU/Software/RasterizerRegCache.cpp
2078
GPU/Software/RasterizerRegCache.h
2079
GPU/Software/Sampler.cpp
2080
GPU/Software/Sampler.h
2081
GPU/Software/SoftGpu.cpp
2082
GPU/Software/SoftGpu.h
2083
GPU/Software/TransformUnit.cpp
2084
GPU/Software/TransformUnit.h
2085
)
2086
2087
set(aemu_postoffice
2088
ext/aemu_postoffice/client/postoffice.c
2089
ext/aemu_postoffice/client/postoffice_mem_stdc.c
2090
ext/aemu_postoffice/client/mutex_impl_cpp.cpp
2091
ext/aemu_postoffice/client/delay_impl_cpp.cpp
2092
ext/aemu_postoffice/client/log_impl_ppsspp.cpp
2093
)
2094
2095
if(WIN32)
2096
list(APPEND aemu_postoffice
2097
ext/aemu_postoffice/client/sock_impl_windows.c
2098
)
2099
endif()
2100
2101
if(LINUX OR ANDROID OR MACOSX OR IOS)
2102
list(APPEND aemu_postoffice
2103
ext/aemu_postoffice/client/sock_impl_linux.c
2104
)
2105
endif()
2106
2107
# 'ppsspp_jni' on ANDROID, 'Core' everywhere else
2108
# SHARED on ANDROID, STATIC everywhere else
2109
add_library(${CoreLibName} ${CoreLinkType}
2110
${CoreExtra}
2111
${CommonJIT}
2112
Core/Config.cpp
2113
Core/Config.h
2114
Core/ConfigSettings.cpp
2115
Core/ConfigSettings.h
2116
Core/ConfigValues.h
2117
Core/ControlMapper.cpp
2118
Core/ControlMapper.h
2119
Core/Core.cpp
2120
Core/Core.h
2121
Core/Compatibility.cpp
2122
Core/Compatibility.h
2123
Core/CoreParameter.h
2124
Core/CoreTiming.cpp
2125
Core/CoreTiming.h
2126
Core/CwCheat.cpp
2127
Core/CwCheat.h
2128
Core/FrameTiming.cpp
2129
Core/FrameTiming.h
2130
Core/HDRemaster.cpp
2131
Core/HDRemaster.h
2132
Core/Instance.cpp
2133
Core/Instance.h
2134
Core/KeyMap.cpp
2135
Core/KeyMap.h
2136
Core/KeyMapDefaults.cpp
2137
Core/KeyMapDefaults.h
2138
Core/LuaContext.cpp
2139
Core/LuaContext.h
2140
Core/RetroAchievements.h
2141
Core/RetroAchievements.cpp
2142
Core/TiltEventProcessor.h
2143
Core/TiltEventProcessor.cpp
2144
Core/WebServer.cpp
2145
Core/WebServer.h
2146
Core/Debugger/Breakpoints.cpp
2147
Core/Debugger/Breakpoints.h
2148
Core/Debugger/DebugInterface.h
2149
Core/Debugger/MemBlockInfo.cpp
2150
Core/Debugger/MemBlockInfo.h
2151
Core/Debugger/SymbolMap.cpp
2152
Core/Debugger/SymbolMap.h
2153
Core/Debugger/Watch.h
2154
Core/Debugger/DisassemblyManager.cpp
2155
Core/Debugger/DisassemblyManager.h
2156
Core/Debugger/WebSocket.cpp
2157
Core/Debugger/WebSocket.h
2158
Core/Debugger/WebSocket/BreakpointSubscriber.cpp
2159
Core/Debugger/WebSocket/BreakpointSubscriber.h
2160
Core/Debugger/WebSocket/CPUCoreSubscriber.cpp
2161
Core/Debugger/WebSocket/CPUCoreSubscriber.h
2162
Core/Debugger/WebSocket/DisasmSubscriber.cpp
2163
Core/Debugger/WebSocket/DisasmSubscriber.h
2164
Core/Debugger/WebSocket/GameBroadcaster.cpp
2165
Core/Debugger/WebSocket/GameBroadcaster.h
2166
Core/Debugger/WebSocket/GameSubscriber.cpp
2167
Core/Debugger/WebSocket/GameSubscriber.h
2168
Core/Debugger/WebSocket/ClientConfigSubscriber.cpp
2169
Core/Debugger/WebSocket/ClientConfigSubscriber.h
2170
Core/Debugger/WebSocket/GPUBufferSubscriber.cpp
2171
Core/Debugger/WebSocket/GPUBufferSubscriber.h
2172
Core/Debugger/WebSocket/GPURecordSubscriber.cpp
2173
Core/Debugger/WebSocket/GPURecordSubscriber.h
2174
Core/Debugger/WebSocket/GPUStatsSubscriber.cpp
2175
Core/Debugger/WebSocket/GPUStatsSubscriber.h
2176
Core/Debugger/WebSocket/HLESubscriber.cpp
2177
Core/Debugger/WebSocket/HLESubscriber.h
2178
Core/Debugger/WebSocket/InputBroadcaster.cpp
2179
Core/Debugger/WebSocket/InputBroadcaster.h
2180
Core/Debugger/WebSocket/InputSubscriber.cpp
2181
Core/Debugger/WebSocket/InputSubscriber.h
2182
Core/Debugger/WebSocket/LogBroadcaster.cpp
2183
Core/Debugger/WebSocket/LogBroadcaster.h
2184
Core/Debugger/WebSocket/MemoryInfoSubscriber.cpp
2185
Core/Debugger/WebSocket/MemoryInfoSubscriber.h
2186
Core/Debugger/WebSocket/MemorySubscriber.cpp
2187
Core/Debugger/WebSocket/MemorySubscriber.h
2188
Core/Debugger/WebSocket/ReplaySubscriber.cpp
2189
Core/Debugger/WebSocket/ReplaySubscriber.h
2190
Core/Debugger/WebSocket/SteppingBroadcaster.cpp
2191
Core/Debugger/WebSocket/SteppingBroadcaster.h
2192
Core/Debugger/WebSocket/SteppingSubscriber.cpp
2193
Core/Debugger/WebSocket/SteppingSubscriber.h
2194
Core/Debugger/WebSocket/WebSocketUtils.cpp
2195
Core/Debugger/WebSocket/WebSocketUtils.h
2196
Core/Dialog/PSPDialog.cpp
2197
Core/Dialog/PSPDialog.h
2198
Core/Dialog/PSPGamedataInstallDialog.cpp
2199
Core/Dialog/PSPGamedataInstallDialog.h
2200
Core/Dialog/PSPMsgDialog.cpp
2201
Core/Dialog/PSPMsgDialog.h
2202
Core/Dialog/PSPNetconfDialog.cpp
2203
Core/Dialog/PSPNetconfDialog.h
2204
Core/Dialog/PSPNpSigninDialog.cpp
2205
Core/Dialog/PSPNpSigninDialog.h
2206
Core/Dialog/PSPOskDialog.cpp
2207
Core/Dialog/PSPOskDialog.h
2208
Core/Dialog/PSPOskConstants.cpp
2209
Core/Dialog/PSPOskConstants.h
2210
Core/Dialog/PSPPlaceholderDialog.cpp
2211
Core/Dialog/PSPPlaceholderDialog.h
2212
Core/Dialog/PSPSaveDialog.cpp
2213
Core/Dialog/PSPSaveDialog.h
2214
Core/Dialog/PSPScreenshotDialog.cpp
2215
Core/Dialog/PSPScreenshotDialog.h
2216
Core/Dialog/SavedataParam.cpp
2217
Core/Dialog/SavedataParam.h
2218
Core/ELF/ElfReader.cpp
2219
Core/ELF/ElfReader.h
2220
Core/ELF/PSPElfTypes.h
2221
Core/ELF/PBPReader.cpp
2222
Core/ELF/PBPReader.h
2223
Core/ELF/PrxDecrypter.cpp
2224
Core/ELF/PrxDecrypter.h
2225
Core/ELF/ParamSFO.cpp
2226
Core/ELF/ParamSFO.h
2227
Core/FFMPEGCompat.h
2228
Core/FileSystems/tlzrc.cpp
2229
Core/FileSystems/BlobFileSystem.cpp
2230
Core/FileSystems/BlobFileSystem.h
2231
Core/FileSystems/BlockDevices.cpp
2232
Core/FileSystems/BlockDevices.h
2233
Core/FileSystems/DirectoryFileSystem.cpp
2234
Core/FileSystems/DirectoryFileSystem.h
2235
Core/FileSystems/FileSystem.h
2236
Core/FileSystems/FileSystem.cpp
2237
Core/FileSystems/ISOFileSystem.cpp
2238
Core/FileSystems/ISOFileSystem.h
2239
Core/FileSystems/MetaFileSystem.cpp
2240
Core/FileSystems/MetaFileSystem.h
2241
Core/FileSystems/VirtualDiscFileSystem.cpp
2242
Core/FileSystems/VirtualDiscFileSystem.h
2243
Core/Font/PGF.cpp
2244
Core/Font/PGF.h
2245
Core/HLE/FunctionWrappers.h
2246
Core/HLE/HLE.cpp
2247
Core/HLE/HLE.h
2248
Core/HLE/ReplaceTables.cpp
2249
Core/HLE/ReplaceTables.h
2250
Core/HLE/HLEHelperThread.cpp
2251
Core/HLE/HLEHelperThread.h
2252
Core/HLE/HLETables.cpp
2253
Core/HLE/HLETables.h
2254
Core/HLE/KernelWaitHelpers.h
2255
Core/HLE/PSPThreadContext.h
2256
Core/HLE/KUBridge.h
2257
Core/HLE/KUBridge.cpp
2258
Core/HLE/Plugins.h
2259
Core/HLE/Plugins.cpp
2260
Core/HLE/ThreadQueueList.h
2261
Core/HLE/__sceAudio.cpp
2262
Core/HLE/__sceAudio.h
2263
Core/HLE/sceAdler.cpp
2264
Core/HLE/sceAdler.h
2265
Core/HLE/AtracBase.h
2266
Core/HLE/AtracCtx.cpp
2267
Core/HLE/AtracCtx.h
2268
Core/HLE/AtracCtx2.cpp
2269
Core/HLE/AtracCtx2.h
2270
Core/HLE/NetInetConstants.cpp
2271
Core/HLE/NetInetConstants.h
2272
Core/HLE/SocketManager.cpp
2273
Core/HLE/SocketManager.h
2274
Core/HLE/sceAtrac.cpp
2275
Core/HLE/sceAtrac.h
2276
Core/HLE/sceAudio.cpp
2277
Core/HLE/sceAudiocodec.cpp
2278
Core/HLE/sceAudiocodec.h
2279
Core/HLE/sceAudioRouting.cpp
2280
Core/HLE/sceAudioRouting.h
2281
Core/HLE/sceAudio.h
2282
Core/HLE/sceCcc.h
2283
Core/HLE/sceCcc.cpp
2284
Core/HLE/sceChnnlsv.cpp
2285
Core/HLE/sceChnnlsv.h
2286
Core/HLE/sceCtrl.cpp
2287
Core/HLE/sceCtrl.h
2288
Core/HLE/sceDeflt.cpp
2289
Core/HLE/sceDeflt.h
2290
Core/HLE/sceDisplay.cpp
2291
Core/HLE/sceDisplay.h
2292
Core/HLE/sceDmac.cpp
2293
Core/HLE/sceDmac.h
2294
Core/HLE/sceG729.cpp
2295
Core/HLE/sceG729.h
2296
Core/HLE/sceGameUpdate.cpp
2297
Core/HLE/sceGameUpdate.h
2298
Core/HLE/sceGe.cpp
2299
Core/HLE/sceGe.h
2300
Core/HLE/sceFont.cpp
2301
Core/HLE/sceFont.h
2302
Core/HLE/sceHeap.cpp
2303
Core/HLE/sceHeap.h
2304
Core/HLE/sceHprm.cpp
2305
Core/HLE/sceHprm.h
2306
Core/HLE/sceHttp.cpp
2307
Core/HLE/sceHttp.h
2308
Core/HLE/sceImpose.cpp
2309
Core/HLE/sceImpose.h
2310
Core/HLE/sceIo.cpp
2311
Core/HLE/sceIo.h
2312
Core/HLE/sceJpeg.cpp
2313
Core/HLE/sceJpeg.h
2314
Core/HLE/sceKernel.cpp
2315
Core/HLE/sceKernel.h
2316
Core/HLE/sceKernelAlarm.cpp
2317
Core/HLE/sceKernelAlarm.h
2318
Core/HLE/sceKernelEventFlag.cpp
2319
Core/HLE/sceKernelEventFlag.h
2320
Core/HLE/sceKernelHeap.cpp
2321
Core/HLE/sceKernelHeap.h
2322
Core/HLE/sceKernelInterrupt.cpp
2323
Core/HLE/sceKernelInterrupt.h
2324
Core/HLE/sceKernelMbx.cpp
2325
Core/HLE/sceKernelMbx.h
2326
Core/HLE/sceKernelMemory.cpp
2327
Core/HLE/sceKernelMemory.h
2328
Core/HLE/sceKernelModule.cpp
2329
Core/HLE/sceKernelModule.h
2330
Core/HLE/sceKernelMsgPipe.cpp
2331
Core/HLE/sceKernelMsgPipe.h
2332
Core/HLE/sceKernelMutex.cpp
2333
Core/HLE/sceKernelMutex.h
2334
Core/HLE/sceKernelSemaphore.cpp
2335
Core/HLE/sceKernelSemaphore.h
2336
Core/HLE/sceKernelThread.cpp
2337
Core/HLE/sceKernelThread.h
2338
Core/HLE/sceKernelTime.cpp
2339
Core/HLE/sceKernelTime.h
2340
Core/HLE/sceKernelVTimer.cpp
2341
Core/HLE/sceKernelVTimer.h
2342
Core/HLE/sceMpeg.cpp
2343
Core/HLE/sceMpeg.h
2344
Core/HLE/sceNet.cpp
2345
Core/HLE/sceNet.h
2346
Core/HLE/sceNet_lib.cpp
2347
Core/HLE/sceNet_lib.h
2348
Core/HLE/NetAdhocCommon.cpp
2349
Core/HLE/NetAdhocCommon.h
2350
Core/HLE/sceNetAdhoc.cpp
2351
Core/HLE/sceNetAdhoc.h
2352
${aemu_postoffice}
2353
Core/HLE/sceNetAdhocMatching.cpp
2354
Core/HLE/sceNetAdhocMatching.h
2355
Core/HLE/sceNetInet.cpp
2356
Core/HLE/sceNetInet.h
2357
Core/HLE/sceNetApctl.cpp
2358
Core/HLE/sceNetApctl.h
2359
Core/HLE/sceNetResolver.cpp
2360
Core/HLE/sceNetResolver.h
2361
Core/HLE/proAdhoc.h
2362
Core/HLE/proAdhoc.cpp
2363
Core/HLE/proAdhocServer.h
2364
Core/HLE/proAdhocServer.cpp
2365
Core/HLE/sceOpenPSID.cpp
2366
Core/HLE/sceOpenPSID.h
2367
Core/HLE/sceP3da.cpp
2368
Core/HLE/sceP3da.h
2369
Core/HLE/sceMt19937.cpp
2370
Core/HLE/sceMt19937.h
2371
Core/HLE/sceMd5.cpp
2372
Core/HLE/sceMd5.h
2373
Core/HLE/sceAac.cpp
2374
Core/HLE/sceAac.h
2375
Core/HLE/sceMp4.cpp
2376
Core/HLE/sceMp4.h
2377
Core/HLE/sceMp3.cpp
2378
Core/HLE/sceMp3.h
2379
Core/HLE/sceParseHttp.cpp
2380
Core/HLE/sceParseHttp.h
2381
Core/HLE/sceParseUri.cpp
2382
Core/HLE/sceParseUri.h
2383
Core/HLE/scePower.cpp
2384
Core/HLE/scePower.h
2385
Core/HLE/scePsmf.cpp
2386
Core/HLE/scePsmf.h
2387
Core/HLE/sceReg.cpp
2388
Core/HLE/sceReg.h
2389
Core/HLE/sceRtc.cpp
2390
Core/HLE/sceRtc.h
2391
Core/HLE/sceSas.cpp
2392
Core/HLE/sceSas.h
2393
Core/HLE/sceSfmt19937.cpp
2394
Core/HLE/sceSfmt19937.h
2395
Core/HLE/sceSha256.cpp
2396
Core/HLE/sceSha256.h
2397
Core/HLE/sceSircs.cpp
2398
Core/HLE/sceSircs.h
2399
Core/HLE/sceSsl.cpp
2400
Core/HLE/sceSsl.h
2401
Core/HLE/sceUmd.cpp
2402
Core/HLE/sceUmd.h
2403
Core/HLE/sceUsb.cpp
2404
Core/HLE/sceUsb.h
2405
Core/HLE/sceUsbAcc.cpp
2406
Core/HLE/sceUsbAcc.h
2407
Core/HLE/sceUsbCam.cpp
2408
Core/HLE/sceUsbCam.h
2409
Core/HLE/sceUsbGps.cpp
2410
Core/HLE/sceUsbGps.h
2411
Core/HLE/sceUsbMic.cpp
2412
Core/HLE/sceUsbMic.h
2413
Core/HLE/sceUtility.cpp
2414
Core/HLE/sceUtility.h
2415
Core/HLE/sceVaudio.cpp
2416
Core/HLE/sceVaudio.h
2417
Core/HLE/scePspNpDrm_user.cpp
2418
Core/HLE/scePspNpDrm_user.h
2419
Core/HLE/sceNp.cpp
2420
Core/HLE/sceNp.h
2421
Core/HLE/sceNp2.cpp
2422
Core/HLE/sceNp2.h
2423
Core/HLE/scePauth.cpp
2424
Core/HLE/scePauth.h
2425
Core/HW/SimpleAudioDec.cpp
2426
Core/HW/SimpleAudioDec.h
2427
Core/HW/Atrac3Standalone.cpp
2428
Core/HW/Atrac3Standalone.h
2429
Core/HW/SimpleAudioDec.h
2430
Core/HW/AsyncIOManager.cpp
2431
Core/HW/AsyncIOManager.h
2432
Core/HW/BufferQueue.cpp
2433
Core/HW/BufferQueue.h
2434
Core/HW/Camera.cpp
2435
Core/HW/Camera.h
2436
Core/HW/Display.cpp
2437
Core/HW/Display.h
2438
Core/HW/GranularMixer.cpp
2439
Core/HW/GranularMixer.h
2440
Core/HW/MediaEngine.cpp
2441
Core/HW/MediaEngine.h
2442
Core/HW/MpegDemux.cpp
2443
Core/HW/MpegDemux.h
2444
Core/HW/MemoryStick.cpp
2445
Core/HW/MemoryStick.h
2446
Core/HW/SasAudio.cpp
2447
Core/HW/SasAudio.h
2448
Core/HW/SasReverb.cpp
2449
Core/HW/SasReverb.h
2450
Core/HW/StereoResampler.cpp
2451
Core/HW/StereoResampler.h
2452
Core/Loaders.cpp
2453
Core/Loaders.h
2454
Core/FileLoaders/CachingFileLoader.cpp
2455
Core/FileLoaders/CachingFileLoader.h
2456
Core/FileLoaders/DiskCachingFileLoader.cpp
2457
Core/FileLoaders/DiskCachingFileLoader.h
2458
Core/FileLoaders/HTTPFileLoader.cpp
2459
Core/FileLoaders/HTTPFileLoader.h
2460
Core/FileLoaders/LocalFileLoader.cpp
2461
Core/FileLoaders/LocalFileLoader.h
2462
Core/FileLoaders/RamCachingFileLoader.cpp
2463
Core/FileLoaders/RamCachingFileLoader.h
2464
Core/FileLoaders/RetryingFileLoader.cpp
2465
Core/FileLoaders/RetryingFileLoader.h
2466
Core/FileLoaders/ZipFileLoader.cpp
2467
Core/FileLoaders/ZipFileLoader.h
2468
Core/MIPS/MIPS.cpp
2469
Core/MIPS/MIPS.h
2470
Core/MIPS/MIPSAnalyst.cpp
2471
Core/MIPS/MIPSAnalyst.h
2472
Core/MIPS/MIPSCodeUtils.cpp
2473
Core/MIPS/MIPSCodeUtils.h
2474
Core/MIPS/MIPSDebugInterface.cpp
2475
Core/MIPS/MIPSDebugInterface.h
2476
Core/MIPS/MIPSDis.cpp
2477
Core/MIPS/MIPSDis.h
2478
Core/MIPS/MIPSDisVFPU.cpp
2479
Core/MIPS/MIPSDisVFPU.h
2480
Core/MIPS/MIPSInt.cpp
2481
Core/MIPS/MIPSInt.h
2482
Core/MIPS/MIPSIntVFPU.cpp
2483
Core/MIPS/MIPSIntVFPU.h
2484
Core/MIPS/MIPSStackWalk.cpp
2485
Core/MIPS/MIPSStackWalk.h
2486
Core/MIPS/MIPSTables.cpp
2487
Core/MIPS/MIPSTables.h
2488
Core/MIPS/MIPSVFPUUtils.cpp
2489
Core/MIPS/MIPSVFPUUtils.h
2490
Core/MIPS/MIPSVFPUFallbacks.cpp
2491
Core/MIPS/MIPSVFPUFallbacks.h
2492
Core/MIPS/MIPSAsm.cpp
2493
Core/MIPS/MIPSAsm.h
2494
Core/MIPS/MIPSTracer.cpp
2495
Core/MIPS/MIPSTracer.h
2496
Core/MemFault.cpp
2497
Core/MemFault.h
2498
Core/MemMap.cpp
2499
Core/MemMap.h
2500
Core/MemMapFunctions.cpp
2501
Core/MemMapHelpers.h
2502
Core/PSPLoaders.cpp
2503
Core/PSPLoaders.h
2504
Core/Reporting.cpp
2505
Core/Reporting.h
2506
Core/Replay.cpp
2507
Core/Replay.h
2508
Core/SaveState.cpp
2509
Core/SaveState.h
2510
Core/SaveStateRewind.cpp
2511
Core/SaveStateRewind.h
2512
Core/Screenshot.cpp
2513
Core/Screenshot.h
2514
Core/System.cpp
2515
Core/System.h
2516
Core/Util/AtracTrack.cpp
2517
Core/Util/AtracTrack.h
2518
Core/Util/AudioFormat.cpp
2519
Core/Util/AudioFormat.h
2520
Core/Util/GameManager.cpp
2521
Core/Util/GameManager.h
2522
Core/Util/MemStick.cpp
2523
Core/Util/MemStick.h
2524
Core/Util/GameDB.cpp
2525
Core/Util/GameDB.h
2526
Core/Util/PathUtil.cpp
2527
Core/Util/PathUtil.h
2528
Core/Util/PortManager.cpp
2529
Core/Util/PortManager.h
2530
Core/Util/BlockAllocator.cpp
2531
Core/Util/BlockAllocator.h
2532
Core/Util/PPGeDraw.cpp
2533
Core/Util/PPGeDraw.h
2534
Core/Util/RecentFiles.cpp
2535
Core/Util/RecentFiles.h
2536
${GPU_SOURCES}
2537
ext/disarm.cpp
2538
ext/disarm.h
2539
ext/riscv-disas.cpp
2540
ext/riscv-disas.h
2541
ext/loongarch-disasm.cpp
2542
ext/loongarch-disasm.h
2543
${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp
2544
)
2545
2546
if(LIBRETRO)
2547
target_include_directories(${CoreLibName} PRIVATE libretro/libretro-common/include)
2548
endif()
2549
2550
if(ANDROID)
2551
list(APPEND CoreExtraLibs android)
2552
if(X86_64)
2553
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic")
2554
endif()
2555
endif()
2556
2557
list(APPEND CoreExtraLibs armips)
2558
2559
# needed for VK_USE_PLATFORM_XCB_KHR only
2560
#if(VULKAN AND NOT WIN32)
2561
# target_link_libraries(native X11-xcb X11)
2562
#endif()
2563
2564
set(GlslangLibs glslang OGLCompiler OSDependent SPIRV spirv-cross-glsl)
2565
2566
if (ENABLE_SPVREMAPPER)
2567
list(APPEND GlslangLibs SPVRemapper)
2568
endif()
2569
2570
if(WIN32)
2571
list(APPEND GlslangLibs spirv-cross-hlsl)
2572
endif()
2573
2574
if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND AND NOT APPLE)
2575
set(OPENGL_LIBRARIES OpenGL::OpenGL)
2576
endif()
2577
2578
if(USE_SYSTEM_ZSTD)
2579
find_package(ZSTD REQUIRED)
2580
target_include_directories(${CoreLibName} PRIVATE ${ZSTD_INCLUDE_DIR})
2581
target_link_libraries(${CoreLibName} ${ZSTD_LIBRARY})
2582
else()
2583
add_subdirectory(ext/zstd-build)
2584
list(APPEND CoreExtraLibs libzstd_static)
2585
include_directories(ext/zstd/lib)
2586
endif()
2587
2588
include_directories(ext/libchdr/include)
2589
2590
target_link_libraries(${CoreLibName} Common native chdr kirk cityhash sfmt19937 xbrz xxhash rcheevos minimp3 at3_standalone lua ${GlslangLibs}
2591
${CoreExtraLibs} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${CMAKE_DL_LIBS})
2592
2593
# Winsock
2594
if(WIN32)
2595
target_link_libraries(${CoreLibName} ws2_32)
2596
endif()
2597
2598
if(NOT HTTPS_NOT_AVAILABLE)
2599
target_link_libraries(${CoreLibName} naett)
2600
endif()
2601
2602
target_compile_features(${CoreLibName} PUBLIC cxx_std_17)
2603
2604
if(FFmpeg_FOUND)
2605
target_compile_definitions(${CoreLibName} PRIVATE USE_FFMPEG=1)
2606
if (HAVE_LIBAVCODEC_CONST_AVCODEC)
2607
target_compile_definitions(${CoreLibName} PRIVATE HAVE_LIBAVCODEC_CONST_AVCODEC=1)
2608
endif()
2609
set_target_properties(${CoreLibName} PROPERTIES NO_SYSTEM_FROM_IMPORTED true)
2610
target_include_directories(${CoreLibName} BEFORE PUBLIC ${FFmpeg_INCLUDE_avcodec} ${FFmpeg_INCLUDE_avformat})
2611
target_link_libraries(${CoreLibName}
2612
FFmpeg::avcodec
2613
FFmpeg::avformat
2614
FFmpeg::avutil
2615
FFmpeg::swresample
2616
FFmpeg::swscale
2617
${ZLIB_LIBRARY}
2618
)
2619
endif()
2620
2621
# Discord integration
2622
if(USE_DISCORD AND NOT IOS AND NOT LIBRETRO)
2623
add_compile_definitions(USE_DISCORD=1)
2624
target_link_libraries(${CoreLibName} discord-rpc)
2625
endif()
2626
2627
# miniUPnPc integration (MiniUPnPc supposed to works on any POSIX system, not sure if some of these are redundant/not needed tho)
2628
if(USE_MINIUPNPC)
2629
if(USE_SYSTEM_MINIUPNPC)
2630
find_package(MINIUPNPC REQUIRED)
2631
target_include_directories(${CoreLibName} PRIVATE ${MINIUPNP_INCLUDE_DIR})
2632
target_link_libraries(${CoreLibName} ${MINIUPNP_LIBRARY})
2633
add_compile_definitions(WITH_UPNP USE_SYSTEM_MINIUPNPC)
2634
else()
2635
set (MINIUPNPC_VERSION 2.2) # used by miniupnpcstrings.h.cmake
2636
set (MINIUPNPC_API_VERSION 18)
2637
option(UPNPC_BUILD_STATIC "Build static library" TRUE)
2638
option(NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE)
2639
mark_as_advanced(NO_GETADDRINFO)
2640
if (NO_GETADDRINFO)
2641
add_compile_definitions(NO_GETADDRINFO)
2642
endif()
2643
2644
if (NOT WIN32)
2645
add_compile_definitions (MINIUPNPC_SET_SOCKET_TIMEOUT)
2646
add_compile_definitions (_BSD_SOURCE _DEFAULT_SOURCE _POSIX_C_SOURCE=200112L)
2647
endif()
2648
if (MACOSX)
2649
add_compile_definitions (_DARWIN_C_SOURCE)
2650
endif()
2651
if(WIN32)
2652
add_compile_definitions(WIN32 MINIUPNP_EXPORTS)
2653
else()
2654
add_compile_options(-fPIC)
2655
endif()
2656
2657
add_compile_definitions(WITH_UPNP MINIUPNP_STATICLIB)
2658
set(MINIUPNP_DIR "ext/miniupnp/miniupnpc")
2659
include_directories(${CMAKE_CURRENT_BINARY_DIR})
2660
include_directories(ext/miniupnp/miniupnpc/src)
2661
include_directories(ext/miniupnp/miniupnpc/include)
2662
configure_file(${MINIUPNP_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h) # by default miniupnp repo doesn't contains miniupnpcstrings.h and need to be generated
2663
set(MINIUPNPC_SOURCES
2664
# the needed bits of miniupnpc (no python module, no tests, no cli)
2665
${MINIUPNP_DIR}/src/addr_is_reserved.c
2666
${MINIUPNP_DIR}/src/connecthostport.c
2667
${MINIUPNP_DIR}/src/igd_desc_parse.c
2668
${MINIUPNP_DIR}/src/minisoap.c
2669
${MINIUPNP_DIR}/src/minissdpc.c
2670
${MINIUPNP_DIR}/src/miniupnpc.c
2671
#${MINIUPNP_DIR}/miniupnpcmodule.c
2672
${MINIUPNP_DIR}/src/miniwget.c
2673
${MINIUPNP_DIR}/src/minixml.c
2674
${MINIUPNP_DIR}/src/portlistingparse.c
2675
${MINIUPNP_DIR}/src/receivedata.c
2676
#${MINIUPNP_DIR}/upnpc.c # causing an error due to already existing _main()
2677
${MINIUPNP_DIR}/src/upnpcommands.c
2678
${MINIUPNP_DIR}/src/upnpdev.c
2679
${MINIUPNP_DIR}/src/upnperrors.c
2680
${MINIUPNP_DIR}/src/upnpreplyparse.c
2681
${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h
2682
)
2683
if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
2684
#set(MINIUPNPC_SOURCES ${MINIUPNPC_SOURCES} minissdpc.c) # causing an error due to duplication in MINIUPNPC_SOURCES?
2685
endif()
2686
if (WIN32)
2687
set_source_files_properties(${MINIUPNPC_SOURCES} PROPERTIES COMPILE_DEFINITIONS "MINIUPNP_STATICLIB;MINIUPNP_EXPORTS")
2688
list(PREPEND LDLIBS ws2_32 iphlpapi)
2689
#elseif (CMAKE_SYSTEM_NAME STREQUAL "Solaris")
2690
# find_library (SOCKET_LIBRARY NAMES socket)
2691
# find_library (NSL_LIBRARY NAMES nsl)
2692
# find_library (RESOLV_LIBRARY NAMES resolv)
2693
# set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS})
2694
endif()
2695
if (UPNPC_BUILD_STATIC)
2696
add_library(miniupnpc STATIC ${MINIUPNPC_SOURCES})
2697
target_link_libraries(${CoreLibName} miniupnpc ${LDLIBS})
2698
set(UPNPC_LIBRARY miniupnpc)
2699
if (MSVC)
2700
# Suppress noise warnings
2701
target_compile_definitions(miniupnpc PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS)
2702
endif()
2703
if (WIN32)
2704
target_link_libraries(miniupnpc ws2_32)
2705
endif()
2706
endif()
2707
endif()
2708
endif()
2709
2710
setup_target_project(${CoreLibName} Core)
2711
2712
# Generate git-version at build time.
2713
add_custom_target(GitVersion DEPENDS something_that_never_exists)
2714
2715
set(WIN_VERSION_CMD "")
2716
if (WIN32)
2717
set(WIN_VERSION_CMD COMMAND ${CMAKE_SOURCE_DIR}/Windows/git-version-gen.cmd PPSSPPWindows)
2718
endif()
2719
2720
add_custom_command(OUTPUT something_that_never_exists
2721
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
2722
-DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
2723
-P ${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake
2724
${WIN_VERSION_CMD})
2725
2726
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/git-version.cpp
2727
PROPERTIES GENERATED TRUE
2728
SKIP_AUTOMOC ON)
2729
add_dependencies(${CoreLibName} GitVersion)
2730
2731
set(WindowsFiles
2732
Windows/WindowsAudio.cpp
2733
Windows/WindowsAudio.h
2734
Windows/WASAPIContext.cpp
2735
Windows/WASAPIContext.h
2736
Windows/Debugger/BreakpointWindow.cpp
2737
Windows/Debugger/BreakpointWindow.h
2738
Windows/Debugger/DumpMemoryWindow.cpp
2739
Windows/Debugger/DumpMemoryWindow.h
2740
Windows/Debugger/CtrlDisAsmView.cpp
2741
Windows/Debugger/CtrlDisAsmView.h
2742
Windows/Debugger/CtrlMemView.cpp
2743
Windows/Debugger/CtrlMemView.h
2744
Windows/Debugger/CtrlRegisterList.cpp
2745
Windows/Debugger/CtrlRegisterList.h
2746
Windows/Debugger/DebuggerShared.cpp
2747
Windows/Debugger/DebuggerShared.h
2748
Windows/Debugger/Debugger_Disasm.cpp
2749
Windows/Debugger/Debugger_Disasm.h
2750
Windows/Debugger/Debugger_MemoryDlg.cpp
2751
Windows/Debugger/Debugger_MemoryDlg.h
2752
Windows/Debugger/Debugger_Lists.cpp
2753
Windows/Debugger/Debugger_Lists.h
2754
Windows/Debugger/Debugger_VFPUDlg.cpp
2755
Windows/Debugger/Debugger_VFPUDlg.h
2756
Windows/Debugger/WatchItemWindow.cpp
2757
Windows/Debugger/WatchItemWindow.h
2758
Windows/Debugger/EditSymbolsWindow.cpp
2759
Windows/Debugger/EditSymbolsWindow.h
2760
Windows/GEDebugger/CtrlDisplayListView.cpp
2761
Windows/GEDebugger/SimpleGLWindow.cpp
2762
Windows/GEDebugger/TabState.cpp
2763
Windows/GEDebugger/VertexPreview.cpp
2764
Windows/GEDebugger/CtrlDisplayListView.h
2765
Windows/GEDebugger/SimpleGLWindow.h
2766
Windows/GEDebugger/TabState.h
2767
Windows/GEDebugger/GEDebugger.cpp
2768
Windows/GEDebugger/TabDisplayLists.cpp
2769
Windows/GEDebugger/TabVertices.cpp
2770
Windows/GEDebugger/GEDebugger.h
2771
Windows/GEDebugger/TabDisplayLists.h
2772
Windows/GEDebugger/TabVertices.h
2773
Windows/BufferLock.h
2774
Windows/CaptureDevice.cpp
2775
Windows/CaptureDevice.h
2776
Windows/DinputDevice.cpp
2777
Windows/DinputDevice.h
2778
Windows/Hid/HidCommon.h
2779
Windows/Hid/HidCommon.cpp
2780
Windows/Hid/HidInputDevice.h
2781
Windows/Hid/HidInputDevice.cpp
2782
Windows/Hid/DualSense.h
2783
Windows/Hid/DualSense.cpp
2784
Windows/Hid/DualShock.h
2785
Windows/Hid/DualShock.cpp
2786
Windows/Hid/SwitchPro.h
2787
Windows/Hid/SwitchPro.cpp
2788
Windows/EmuThread.cpp
2789
Windows/EmuThread.h
2790
Windows/GPU/D3D11Context.cpp
2791
Windows/GPU/D3D11Context.h
2792
Windows/GPU/WindowsGLContext.cpp
2793
Windows/GPU/WindowsVulkanContext.cpp
2794
Windows/InputBox.cpp
2795
Windows/InputBox.h
2796
Windows/InputDevice.cpp
2797
Windows/InputDevice.h
2798
Windows/W32Util/ContextMenu.h
2799
Windows/W32Util/ContextMenu.h
2800
Windows/W32Util/DialogManager.cpp
2801
Windows/W32Util/DialogManager.h
2802
Windows/W32Util/Misc.cpp
2803
Windows/W32Util/Misc.h
2804
Windows/W32Util/ShellUtil.cpp
2805
Windows/W32Util/ShellUtil.h
2806
Windows/W32Util/TabControl.cpp
2807
Windows/W32Util/TabControl.h
2808
Windows/W32Util/IatHook.h
2809
Windows/W32Util/ContextMenu.h
2810
Windows/W32Util/ContextMenu.cpp
2811
Windows/W32Util/DarkMode.h
2812
Windows/W32Util/DarkMode.cpp
2813
Windows/W32Util/UAHMenuBar.h
2814
Windows/W32Util/UAHMenuBar.cpp
2815
Windows/MainWindow.cpp
2816
Windows/MainWindow.h
2817
Windows/MainWindowMenu.cpp
2818
Windows/MainWindowMenu.h
2819
Windows/RawInput.cpp
2820
Windows/RawInput.h
2821
Windows/TouchInputHandler.cpp
2822
Windows/TouchInputHandler.h
2823
Windows/XinputDevice.cpp
2824
Windows/XinputDevice.h
2825
Windows/main.cpp
2826
Windows/main.h
2827
Windows/ppsspp.rc
2828
Windows/resource.h
2829
Windows/stdafx.cpp
2830
Windows/stdafx.h
2831
)
2832
2833
if(ANDROID AND ARM64)
2834
# Support 16kb page size on Android
2835
target_link_options(${CoreLibName} PRIVATE "-Wl,-z,max-page-size=16384")
2836
endif()
2837
2838
list(APPEND LinkCommon ${CoreLibName} ${CMAKE_THREAD_LIBS_INIT})
2839
2840
if(WIN32)
2841
#setup_target_project(${TargetBin} Windows)
2842
list(APPEND NativeAppSource ${WindowsFiles})
2843
endif()
2844
2845
set(BigFontAssets
2846
assets/font_atlas.zim
2847
assets/font_atlas.meta
2848
)
2849
2850
set(NativeAssets
2851
assets/asciifont_atlas.zim
2852
assets/asciifont_atlas.meta
2853
assets/debugger
2854
assets/upload
2855
assets/lang
2856
assets/shaders
2857
assets/themes
2858
assets/vfpu
2859
assets/Roboto_Condensed-Regular.ttf
2860
assets/Roboto_Condensed-Light.ttf
2861
assets/Roboto_Condensed-Bold.ttf
2862
assets/Roboto_Condensed-Italic.ttf
2863
assets/Inconsolata-Regular.ttf
2864
assets/7z.png
2865
assets/compat.ini
2866
assets/infra-dns.json
2867
assets/gamecontrollerdb.txt
2868
assets/langregion.ini
2869
assets/ppge_atlas.zim
2870
assets/ppge_atlas.meta
2871
assets/rargray.png
2872
assets/unknown.png
2873
assets/zip.png
2874
assets/sfx_back.wav
2875
assets/sfx_confirm.wav
2876
assets/sfx_select.wav
2877
assets/sfx_toggle_off.wav
2878
assets/sfx_toggle_on.wav
2879
assets/sfx_achievement_unlocked.wav
2880
assets/sfx_leaderbord_submitted.wav
2881
)
2882
2883
file(GLOB UIImages CONFIGURE_DEPENDS
2884
assets/ui_images/*.png
2885
assets/ui_images/*.svg
2886
)
2887
2888
if(HEADLESS)
2889
set(HeadlessSource
2890
headless/Headless.cpp
2891
headless/HeadlessHost.cpp
2892
headless/HeadlessHost.h
2893
headless/Compare.cpp
2894
headless/Compare.h
2895
headless/SDLHeadlessHost.cpp
2896
headless/SDLHeadlessHost.h
2897
)
2898
if(WIN32)
2899
list(APPEND HeadlessSource
2900
headless/WindowsHeadlessHost.cpp
2901
headless/WindowsHeadlessHost.h
2902
Windows/GPU/D3D11Context.cpp
2903
Windows/GPU/D3D11Context.h
2904
Windows/GPU/WindowsGLContext.cpp
2905
Windows/GPU/WindowsVulkanContext.cpp
2906
Windows/W32Util/ShellUtil.cpp
2907
Windows/W32Util/ShellUtil.h
2908
Windows/CaptureDevice.cpp
2909
Windows/CaptureDevice.h
2910
Windows/W32Util/Misc.cpp
2911
Windows/W32Util/Misc.h
2912
)
2913
endif()
2914
add_executable(PPSSPPHeadless ${HeadlessSource})
2915
target_link_libraries(PPSSPPHeadless ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY} ${LinkCommon})
2916
setup_target_project(PPSSPPHeadless headless)
2917
endif()
2918
2919
if(UNITTEST)
2920
add_executable(PPSSPPUnitTest
2921
unittest/UnitTest.cpp
2922
unittest/TestShaderGenerators.cpp
2923
unittest/TestArmEmitter.cpp
2924
unittest/TestArm64Emitter.cpp
2925
unittest/TestIRPassSimplify.cpp
2926
unittest/TestX64Emitter.cpp
2927
unittest/TestVertexJit.cpp
2928
unittest/TestVFS.cpp
2929
unittest/TestRiscVEmitter.cpp
2930
unittest/TestLoongArch64Emitter.cpp
2931
unittest/TestSoftwareGPUJit.cpp
2932
unittest/TestThreadManager.cpp
2933
unittest/JitHarness.cpp
2934
Core/MIPS/ARM/ArmRegCache.cpp
2935
Core/MIPS/ARM/ArmRegCacheFPU.cpp
2936
)
2937
if(WIN32)
2938
target_sources(PPSSPPUnitTest PRIVATE
2939
Windows/CaptureDevice.cpp
2940
Windows/CaptureDevice.h
2941
)
2942
endif()
2943
target_link_libraries(PPSSPPUnitTest ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY} ${LinkCommon} Common)
2944
setup_target_project(PPSSPPUnitTest unittest)
2945
add_test(arm64_emitter PPSSPPUnitTest Arm64Emitter)
2946
add_test(arm_emitter PPSSPPUnitTest ArmEmitter)
2947
add_test(x64_emitter PPSSPPUnitTest X64Emitter)
2948
add_test(vertex_jit PPSSPPUnitTest VertexJit)
2949
add_test(asin PPSSPPUnitTest Asin)
2950
add_test(sincos PPSSPPUnitTest SinCos)
2951
add_test(vfpu_sincos PPSSPPUnitTest VFPUSinCos)
2952
add_test(math_util PPSSPPUnitTest MathUtil)
2953
add_test(parsers PPSSPPUnitTest Parsers)
2954
add_test(jit PPSSPPUnitTest Jit)
2955
add_test(matrix_transpose PPSSPPUnitTest VFPUMatrixTranspose)
2956
add_test(parse_lbn PPSSPPUnitTest ParseLBN)
2957
add_test(quick_texhash PPSSPPUnitTest QuickTexHash)
2958
add_test(clz PPSSPPUnitTest CLZ)
2959
add_test(shadergen PPSSPPUnitTest ShaderGenerators)
2960
endif()
2961
2962
if(ATLAS_TOOL)
2963
include_directories(ext/freetype/include)
2964
2965
set(AtlasToolSource
2966
ext/native/tools/atlastool.cpp
2967
)
2968
add_executable(AtlasTool ${AtlasToolSource})
2969
target_link_libraries(AtlasTool ${LinkCommon} freetype)
2970
setup_target_project(AtlasTool atlastool)
2971
endif()
2972
2973
if(LIBRETRO)
2974
add_subdirectory(libretro)
2975
endif()
2976
2977
if(TargetBin)
2978
if(APPLE)
2979
if(NOT IOS)
2980
if(GOLD)
2981
set(ICON_PATH_ABS ${CMAKE_CURRENT_SOURCE_DIR}/icons/ppsspp_gold.icns)
2982
set(MACOSX_BUNDLE_ICON_FILE ppsspp_gold.icns)
2983
set(MACOSX_BUNDLE_BUNDLE_NAME "PPSSPP Gold")
2984
set(MACOSX_BUNDLE_GUI_IDENTIFIER org.ppsspp.ppssppgold)
2985
else()
2986
set(ICON_PATH_ABS ${CMAKE_CURRENT_SOURCE_DIR}/icons/ppsspp.icns)
2987
set(MACOSX_BUNDLE_ICON_FILE ppsspp.icns)
2988
set(MACOSX_BUNDLE_BUNDLE_NAME "PPSSPP")
2989
set(MACOSX_BUNDLE_GUI_IDENTIFIER org.ppsspp.ppsspp)
2990
endif()
2991
set_source_files_properties(${ICON_PATH_ABS} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
2992
endif()
2993
2994
# TODO: there must a native way to copy these.
2995
# Now this is very prone to errors when changes occur.
2996
# Also better to have assets under Resources dir for OS X.
2997
file(GLOB_RECURSE FLASH0_FILES assets/flash0/*)
2998
file(GLOB_RECURSE LANG_FILES assets/lang/*)
2999
file(GLOB_RECURSE SHADER_FILES assets/shaders/*)
3000
file(GLOB_RECURSE THEME_FILE assets/themes/*)
3001
file(GLOB_RECURSE DEBUGGER_FILES assets/debugger/*)
3002
file(GLOB_RECURSE WEB_UPLOAD_FILES assets/upload/*)
3003
file(GLOB_RECURSE VFPU_FILES assets/vfpu/*)
3004
3005
if(NOT IOS)
3006
set_source_files_properties(${BigFontAssets} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets")
3007
set_source_files_properties(${NativeAssets} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets")
3008
set_source_files_properties(${UIImages} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/ui_images")
3009
set_source_files_properties(${FLASH0_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/flash0/font")
3010
set_source_files_properties(${LANG_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/lang")
3011
set_source_files_properties(${SHADER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/shaders")
3012
set_source_files_properties(${THEME_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/themes")
3013
set_source_files_properties(${DEBUGGER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/debugger")
3014
set_source_files_properties(${WEB_UPLOAD_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/upload")
3015
set_source_files_properties(${VFPU_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/vfpu")
3016
endif()
3017
3018
if(IOS)
3019
set(AssetCatalog "${CMAKE_SOURCE_DIR}/ios/assets.xcassets")
3020
add_executable(${TargetBin} MACOSX_BUNDLE ${NativeAssets} ${BigFontAssets} ${UIImages} ${AssetCatalog} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${WEB_UPLOAD_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard")
3021
if(NOT IOS_APP_STORE)
3022
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/iOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPP.app/Frameworks/")
3023
endif()
3024
else()
3025
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${UIImages} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${WEB_UPLOAD_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
3026
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/${TargetBin}.app/Contents/Frameworks/")
3027
if(USING_QT_UI)
3028
add_custom_command(TARGET ${TargetBin} POST_BUILD COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/Qt/macbundle.sh" "${CMAKE_BINARY_DIR}/PPSSPPQt.app")
3029
elseif(NOT USE_SYSTEM_LIBSDL2)
3030
add_custom_command(TARGET ${TargetBin} POST_BUILD COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/SDL/macbundle.sh" "${CMAKE_BINARY_DIR}/${TargetBin}.app" "${TargetBin}")
3031
endif()
3032
endif()
3033
elseif(WIN32)
3034
add_executable(${TargetBin} WIN32 ${NativeAppSource})
3035
if(NOT MSVC)
3036
target_compile_options(${TargetBin} PRIVATE $<$<CXX_COMPILER_ID:Clang>:-Wno-c++11-narrowing>)
3037
endif()
3038
target_link_libraries(${TargetBin} avrt comctl32 dinput8 dwmapi hid ksuser mfplat setupapi uxtheme version)
3039
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${TargetBin})
3040
else()
3041
add_executable(${TargetBin} ${NativeAppSource})
3042
endif()
3043
if(ANDROID AND ARM64)
3044
target_link_options(${TargetBin} PRIVATE "-Wl,-z,max-page-size=16384")
3045
endif()
3046
target_link_libraries(${TargetBin} ${LinkCommon} Common)
3047
endif()
3048
3049
# installs
3050
if(NOT ANDROID)
3051
file(INSTALL ${BigFontAssets} DESTINATION assets)
3052
file(INSTALL ${NativeAssets} DESTINATION assets)
3053
file(INSTALL ${UIImages} DESTINATION assets/ui_images)
3054
file(INSTALL assets/flash0 DESTINATION assets)
3055
endif()
3056
# packaging and code signing
3057
if(IOS AND NOT LIBRETRO)
3058
if(IOS_APP_STORE)
3059
set(DEPLOYMENT_TARGET 13.0)
3060
else()
3061
set(DEPLOYMENT_TARGET 11.0)
3062
endif()
3063
file(GLOB IOSAssets ios/assets/*.png)
3064
list(REMOVE_ITEM IOSAssets ${CMAKE_CURRENT_SOURCE_DIR}/ios/assets/[email protected])
3065
list(REMOVE_ITEM IOSAssets ${CMAKE_CURRENT_SOURCE_DIR}/ios/assets/[email protected])
3066
file(INSTALL ${IOSAssets} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/assets)
3067
file(GLOB IOSAssets ios/assets/Default-568h@*.png)
3068
file(INSTALL ${IOSAssets} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
3069
if(IOS_DEBUG)
3070
file(INSTALL pspautotests DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/assets)
3071
endif()
3072
set(RSRC_XIB_FILES "Launch Screen.storyboard" ${CMAKE_CURRENT_SOURCE_DIR}/ios/assets.xcassets)
3073
3074
set_source_files_properties(${RSRC_XIB_FILES}
3075
PROPERTIES MACOSX_PACKAGE_LOCATION Resources
3076
)
3077
3078
#This breaks in modern XCode. Not sure when it worked...
3079
#if(CMAKE_GENERATOR STREQUAL "Xcode")
3080
# set(APP_DIR_NAME "$(TARGET_BUILD_DIR)/$(FULL_PRODUCT_NAME)")
3081
#else()
3082
set(APP_DIR_NAME "$<TARGET_FILE_DIR:PPSSPP>")
3083
#endif()
3084
3085
set(MACOSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET})
3086
set(PRODUCT_NAME "PPSSPP")
3087
set(BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/ios/PPSSPP-Info.plist")
3088
set(BUNDLE_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/ios/App.entitlements")
3089
if(GOLD)
3090
if(IOS_APP_STORE)
3091
set(BUNDLE_IDENTIFIER "org.ppsspp.ppsspp-gold")
3092
else()
3093
set(BUNDLE_IDENTIFIER "org.ppsspp.ppssppgold")
3094
endif()
3095
set(ICON_NAME "PPSSPPGold")
3096
set(DISPLAY_NAME "PPSSPP Gold")
3097
else()
3098
if(IOS_APP_STORE)
3099
set(BUNDLE_IDENTIFIER "org.ppsspp.ppsspp-free")
3100
else()
3101
set(BUNDLE_IDENTIFIER "org.ppsspp.ppsspp")
3102
endif()
3103
set(ICON_NAME "AppIcon")
3104
set(DISPLAY_NAME "PPSSPP")
3105
endif()
3106
if(IOS_APP_STORE)
3107
message(STATUS "DevTeam: ${DEVELOPMENT_TEAM_ID} Icon: ${ICON_NAME} Target: ${TargetBin} Gold: ${GOLD} IAP: ${USE_IAP}")
3108
message(STATUS "CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
3109
3110
# This is for injecting the version into the plist, and also copying resources.
3111
# Should find a different way to do both these things.
3112
add_custom_command(TARGET ${TargetBin} POST_BUILD
3113
COMMAND echo "Creating ${APP_DIR_NAME} for app store build"
3114
COMMAND echo "CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}"
3115
COMMAND echo "BINARY_DIR: ${CMAKE_BINARY_DIR}"
3116
COMMAND mkdir -p \"${APP_DIR_NAME}\"
3117
# This tar command seems to be responsible for copying assets. I thought we had another step that did that..
3118
# Prepend -v to the extracting command to see the files copied.
3119
COMMAND tar -c -C ${CMAKE_CURRENT_BINARY_DIR} --exclude .DS_Store --exclude .git assets *.png | tar -x -C \"${APP_DIR_NAME}\"
3120
# This updates the version in the plist.
3121
COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/ios/iosbundle.sh" \"${APP_DIR_NAME}\" "${CMAKE_CURRENT_BINARY_DIR}"
3122
)
3123
3124
# Can't figure out properly using .xcframework from CMake, so just linking directly to the .a file.
3125
target_link_libraries(${TargetBin}
3126
"${CMAKE_CURRENT_SOURCE_DIR}/ios/MoltenVK/MoltenVK.xcframework/ios-arm64/libMoltenVK.a"
3127
)
3128
# https://stackoverflow.com/questions/40664125/cmake-and-code-signing-in-xcode-8-for-ios-projects
3129
target_compile_options(${TargetBin} PRIVATE
3130
$<$<CONFIG:Release>:-g -gline-tables-only>
3131
)
3132
target_compile_options(${TargetBin} PRIVATE
3133
$<$<CONFIG:RelWithDebInfo>:-g>
3134
)
3135
set_target_properties(${TargetBin} PROPERTIES
3136
XCODE_GENERATE_SCHEME YES # Avoid the scheme bloat in XCode by only setting it to YES for this target.
3137
RESOURCE "ios/Launch Screen.storyboard"
3138
RESOURCE "ios/Settings.bundle"
3139
RESOURCE "ios/assets.xcassets"
3140
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${BUNDLE_IDENTIFIER}
3141
XCODE_ATTRIBUTE_PRODUCT_NAME ${PRODUCT_NAME}
3142
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME ${ICON_NAME}
3143
BUILD_WITH_INSTALL_RPATH YES
3144
MACOSX_BUNDLE_INFO_PLIST ${BUNDLE_PLIST}
3145
# Some sources say we should generate the PLIST. There's stuff in it that
3146
# I don't know how to generate, though.
3147
#XCODE_ATTRIBUTE_GENERATE_INFOPLIST_FILE "YES"
3148
#XCODE_ATTRIBUTE_INFOPLIST_KEY_UIRequiredDeviceCapabilities arm64
3149
XCODE_ATTRIBUTE_INFOPLIST_KEY_UIFileSharingEnabled YES
3150
XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY YES
3151
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY YES
3152
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}
3153
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
3154
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
3155
XCODE_ATTRIBUTE_ENABLE_BITCODE NO
3156
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${DEVELOPMENT_TEAM_ID}
3157
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development"
3158
XCODE_ATTRIBUTE_CODE_SIGN_STYLE "Automatic"
3159
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS YES
3160
3161
XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
3162
XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING[variant=Release] "YES"
3163
XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT[variant=Release] "YES"
3164
3165
#XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${BUNDLE_ENTITLEMENTS}
3166
XCODE_ATTRIBUTE_SKIP_INSTALL NO
3167
XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
3168
)
3169
else()
3170
# This is for injecting the version into the plist.
3171
add_custom_command(TARGET PPSSPP POST_BUILD
3172
COMMAND echo "Creating ${APP_DIR_NAME} for sideload build"
3173
COMMAND mkdir -p \"${APP_DIR_NAME}\"
3174
COMMAND tar -c -C ${CMAKE_CURRENT_BINARY_DIR} --exclude .DS_Store --exclude .git assets *.png | tar -x -C \"${APP_DIR_NAME}\"
3175
COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/ios/macbundle.sh" \"${APP_DIR_NAME}\"
3176
)
3177
3178
set_target_properties(${TargetBin} PROPERTIES
3179
MACOSX_BUNDLE_INFO_PLIST ${BUNDLE_PLIST}
3180
XCODE_GENERATE_SCHEME YES
3181
RESOURCE "ios/Launch Screen.storyboard"
3182
RESOURCE "ios/Settings.bundle"
3183
RESOURCE "ext/vulkan/iOS/Frameworks"
3184
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME ${ICON_NAME}
3185
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}
3186
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
3187
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
3188
XCODE_ATTRIBUTE_ENABLE_BITCODE NO
3189
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-"
3190
)
3191
endif()
3192
add_custom_command(TARGET PPSSPP POST_BUILD
3193
COMMAND plutil -replace CFBundleDisplayName -string "${DISPLAY_NAME}" "${APP_DIR_NAME}/Info.plist"
3194
COMMAND plutil -replace CFBundleIdentifier -string "${BUNDLE_IDENTIFIER}" "${APP_DIR_NAME}/Info.plist"
3195
)
3196
endif()
3197
3198
if(MACOSX AND NOT IOS)
3199
if(GOLD)
3200
set_target_properties(${TargetBin} PROPERTIES
3201
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/macOS/InfoGold.plist"
3202
)
3203
else()
3204
set_target_properties(${TargetBin} PROPERTIES
3205
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist"
3206
)
3207
endif()
3208
endif()
3209
3210
if(UNIX AND NOT ANDROID AND NOT APPLE)
3211
configure_file(
3212
"${CMAKE_SOURCE_DIR}/ppsspp.desktop.in"
3213
"${CMAKE_BINARY_DIR}/ppsspp.desktop"
3214
@ONLY
3215
)
3216
install(
3217
TARGETS ${TargetBin}
3218
DESTINATION "${CMAKE_INSTALL_BINDIR}"
3219
)
3220
install(
3221
DIRECTORY "${CMAKE_BINARY_DIR}/assets"
3222
DESTINATION "${CMAKE_INSTALL_DATADIR}/ppsspp"
3223
PATTERN ".git*" EXCLUDE
3224
PATTERN "mime" EXCLUDE
3225
PATTERN "lang/README.md" EXCLUDE
3226
)
3227
install(
3228
FILES "${CMAKE_BINARY_DIR}/ppsspp.desktop"
3229
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
3230
RENAME ${TargetBin}.desktop
3231
)
3232
install(
3233
DIRECTORY "${CMAKE_SOURCE_DIR}/icons/hicolor"
3234
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons"
3235
)
3236
install(
3237
FILES "${CMAKE_SOURCE_DIR}/icons/icon-512.svg"
3238
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps"
3239
RENAME "ppsspp.svg"
3240
)
3241
install(
3242
FILES "${CMAKE_SOURCE_DIR}/assets/mime/ppsspp.xml"
3243
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages"
3244
)
3245
endif()
3246
3247