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