forked from Rinnegatamante/flycast-vita
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
1658 lines (1542 loc) · 63.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
cmake_minimum_required(VERSION 3.10.2)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE STRING "Compiler launcher for C.")
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM} CACHE STRING "Compiler launcher for CXX.")
endif()
option(ENABLE_CTEST "Enables unit tests" OFF)
option(ENABLE_OPROFILE "Enable OProfile" OFF)
option(TEST_AUTOMATION "Enable test automation" OFF)
option(ENABLE_LOG "Enable full logging" OFF)
option(ASAN "Enable address sanitizer" OFF)
option(USE_GLES "Use GLES[3] API" OFF)
option(USE_GLES2 "Use GLES2 API" OFF)
option(USE_HOST_LIBZIP "Use host libzip" ON)
option(USE_OPENMP "Use OpenMP if available" ON)
option(USE_VULKAN "Build with Vulkan support" ON)
option(LIBRETRO "Build libretro core" OFF)
option(USE_OPENGL "Use Open GL API" ON)
option(USE_VIDEOCORE "RPI: use the legacy Broadcom GLES libraries" OFF)
option(APPLE_BREAKPAD "macOS: Build breakpad client and dump symbols" OFF)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/shell/cmake")
if(APPLE)
if(CMAKE_SYSTEM_NAME STREQUAL iOS)
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING "Minimum iOS deployment version")
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "")
set(USE_VULKAN OFF CACHE BOOL "Force vulkan off" FORCE)
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum macOS deployment version")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
endif()
endif()
if (VITA)
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{VITASDK})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
else()
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
endif()
endif()
endif()
if(LIBRETRO)
project(flycast_libretro)
else()
project(flycast)
endif()
include(GNUInstallDirs)
if(ENABLE_CTEST)
include(CTest)
endif()
if(IOS AND NOT LIBRETRO)
set(CMAKE_Swift_LANGUAGE_VERSION 5.0)
enable_language(Swift)
endif()
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --always
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(WINDOWS_STORE)
string(REPLACE "v" "" MS_VERSION ${GIT_VERSION})
string(REPLACE "-" "." MS_VERSION ${MS_VERSION})
string(REGEX REPLACE "\.g[0-9a-f]+" "" MS_VERSION ${MS_VERSION})
string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+" VERSION_3PARTS ${MS_VERSION})
if (VERSION_3PARTS STREQUAL "")
string(APPEND MS_VERSION ".0.0")
else()
string(APPEND MS_VERSION ".0")
endif()
endif()
endif()
string(TIMESTAMP BUILD_TIMESTAMP UTC)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/core/version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/core/version.h" @ONLY)
if(VITA)
include("${VITASDK}/share/vita.cmake" REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-q,--wrap,memcpy,--wrap,memset,--wrap,malloc,--wrap,memalign,--wrap,free,--wrap,calloc,--wrap,realloc -O3 -DNDEBUG -fno-optimize-sibling-calls -fsigned-char -fno-short-enums -marm")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q,--wrap,malloc,--wrap,memalign,--wrap,free,--wrap,calloc,--wrap,realloc -O3 -DNDEBUG -fno-optimize-sibling-calls -fsigned-char -fno-short-enums -marm")
set(VITA_APP_NAME "Flycast")
set(VITA_TITLEID "FLYCASTDC")
set(VITA_VPKNAME "Flycast")
set(VITA_VERSION "01.00")
set(VITA_MKSFOEX_FLAGS "-d ATTRIBUTE2=12")
set(USE_VULKAN OFF)
set(USE_GLES2 ON)
enable_language(ASM)
add_executable(${PROJECT_NAME} core/emulator.cpp)
target_compile_definitions(${PROJECT_NAME} PRIVATE EGL_NO_PLATFORM_SPECIFIC_TYPES)
# target_compile_definitions(${PROJECT_NAME} PRIVATE TARGET_NO_EXCEPTIONS)
target_compile_definitions(${PROJECT_NAME} PRIVATE VITA _GNU_SOURCE)
target_compile_definitions(${PROJECT_NAME} PRIVATE GLES)
# For proper fseek/ftell definition in external dependency "libchdr", doesn't impact anything else:
target_compile_definitions(${PROJECT_NAME} PRIVATE __PS3__)
elseif(NINTENDO_SWITCH)
set(USE_VULKAN OFF)
enable_language(ASM)
if(LIBRETRO)
add_library(${PROJECT_NAME} STATIC core/emulator.cpp)
target_compile_definitions(${PROJECT_NAME} PRIVATE LIBRETRO HAVE_LIBNX HAVE_OPENGL HAVE_OIT)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "flycast_libretro_libnx")
set(CMAKE_STATIC_LIBRARY_PREFIX "")
else()
add_executable(${PROJECT_NAME} core/emulator.cpp)
target_compile_definitions(${PROJECT_NAME} PRIVATE EGL_NO_PLATFORM_SPECIFIC_TYPES)
endif()
if(USE_GLES)
target_compile_definitions(${PROJECT_NAME} PRIVATE GLES)
endif()
elseif(LIBRETRO)
add_library(${PROJECT_NAME} SHARED core/emulator.cpp)
if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
else()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "flycast_libretro")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(${PROJECT_NAME} PRIVATE LIBRETRO)
if(ANDROID OR USE_GLES)
target_compile_definitions(${PROJECT_NAME} PRIVATE GLES GLES3 HAVE_OPENGLES HAVE_OPENGLES3)
find_library(GLES3_LIBRARIES NAMES GLESv3 GLESv2 NO_CACHE REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE ${GLES3_LIBRARIES})
elseif(USE_GLES2)
target_compile_definitions(${PROJECT_NAME} PRIVATE GLES GLES2 HAVE_OPENGLES HAVE_OPENGLES2)
if(USE_VIDEOCORE)
target_compile_definitions(${PROJECT_NAME} PRIVATE TARGET_NO_STENCIL)
target_link_libraries(${PROJECT_NAME} PRIVATE "-lbrcmGLESv2")
target_link_directories(${PROJECT_NAME} PRIVATE "/opt/vc/lib")
else()
target_link_libraries(${PROJECT_NAME} PRIVATE "-lGLESv2")
endif()
elseif(USE_OPENGL)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_OPENGL)
if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-framework,OpenGL")
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_OIT)
endif()
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE "-lopengl32")
endif()
endif()
elseif(ANDROID)
add_library(${PROJECT_NAME} SHARED core/emulator.cpp)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} -O3")
target_compile_options(${PROJECT_NAME} PRIVATE -fno-stack-protector)
set(CMAKE_ANDROID_STL_TYPE "c++_static")
elseif(MSVC)
add_executable(${PROJECT_NAME} WIN32 core/emulator.cpp)
else()
add_executable(${PROJECT_NAME} MACOSX_BUNDLE core/emulator.cpp)
endif()
if(WINDOWS_STORE)
set(USE_OPENGL OFF)
target_compile_features(${PROJECT_NAME} PRIVATE c_std_11 cxx_std_17)
else()
target_compile_features(${PROJECT_NAME} PRIVATE c_std_11 cxx_std_11)
endif()
if(NOT VITA)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_EXTENSIONS OFF
LINK_FLAGS_RELEASE -s)
endif()
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /GR- /GS-)
if(WINDOWS_STORE)
target_compile_options(${PROJECT_NAME} PRIVATE /ZW)
endif()
else()
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-fno-strict-aliasing>
$<$<COMPILE_LANGUAGE:CXX>:-Wall>)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-Wno-nullability-completeness>)
endif()
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE
$<$<BOOL:APPLE>:GL_SILENCE_DEPRECATION>
$<$<BOOL:MSVC>:_CRT_NONSTDC_NO_WARNINGS>
$<$<BOOL:MSVC>:_CRT_SECURE_NO_WARNINGS>
$<$<BOOL:MSVC>:_USE_MATH_DEFINES>
$<$<BOOL:MSVC>:NOMINMAX>
$<$<BOOL:${TEST_AUTOMATION}>:TEST_AUTOMATION>
$<$<BOOL:${ENABLE_LOG}>:DEBUGFAST>)
if(IOS)
target_compile_definitions(${PROJECT_NAME} PRIVATE
TARGET_IPHONE
GLES
GLES3
GLES_SILENCE_DEPRECATION)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE core core/deps core/deps/stb core/khronos)
if(LIBRETRO)
target_include_directories(${PROJECT_NAME} PRIVATE shell/libretro)
endif()
if(NINTENDO_SWITCH)
target_include_directories(${PROJECT_NAME} PRIVATE shell/switch "${DEVKITPRO}/portlibs/switch/include")
endif()
if(NOT LIBRETRO)
if((WIN32 AND NOT MSVC) OR (UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES "(FreeBSD|OpenBSD|NetBSD)"))
add_subdirectory(core/deps/breakpad)
if(WIN32)
target_link_options(${PROJECT_NAME} PRIVATE "-Wl,--build-id")
endif()
target_link_libraries(${PROJECT_NAME} PUBLIC breakpad_client)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_BREAKPAD)
elseif(APPLE AND NOT IOS AND APPLE_BREAKPAD)
target_sources(${PROJECT_NAME} PRIVATE
core/deps/breakpad/src/client/minidump_file_writer-inl.h
core/deps/breakpad/src/client/minidump_file_writer.cc
core/deps/breakpad/src/client/minidump_file_writer.h
core/deps/breakpad/src/client/mac/handler/breakpad_nlist_64.cc
core/deps/breakpad/src/client/mac/handler/breakpad_nlist_64.h
core/deps/breakpad/src/client/mac/handler/dynamic_images.cc
core/deps/breakpad/src/client/mac/handler/dynamic_images.h
core/deps/breakpad/src/client/mac/handler/exception_handler.cc
core/deps/breakpad/src/client/mac/handler/exception_handler.h
core/deps/breakpad/src/client/mac/handler/minidump_generator.cc
core/deps/breakpad/src/client/mac/handler/minidump_generator.h
core/deps/breakpad/src/client/mac/handler/protected_memory_allocator.cc
core/deps/breakpad/src/client/mac/handler/protected_memory_allocator.h
core/deps/breakpad/src/client/mac/crash_generation/ConfigFile.h
core/deps/breakpad/src/client/mac/crash_generation/ConfigFile.mm
core/deps/breakpad/src/client/mac/crash_generation/client_info.h
core/deps/breakpad/src/client/mac/crash_generation/crash_generation_client.h
core/deps/breakpad/src/client/mac/crash_generation/crash_generation_client.cc
core/deps/breakpad/src/common/convert_UTF.cc
core/deps/breakpad/src/common/convert_UTF.h
core/deps/breakpad/src/common/md5.cc
core/deps/breakpad/src/common/string_conversion.cc
core/deps/breakpad/src/common/string_conversion.h
core/deps/breakpad/src/common/mac/file_id.cc
core/deps/breakpad/src/common/mac/file_id.h
core/deps/breakpad/src/common/mac/MachIPC.mm
core/deps/breakpad/src/common/mac/MachIPC.h
core/deps/breakpad/src/common/mac/bootstrap_compat.cc
core/deps/breakpad/src/common/mac/bootstrap_compat.h
core/deps/breakpad/src/common/mac/macho_id.cc
core/deps/breakpad/src/common/mac/macho_id.h
core/deps/breakpad/src/common/mac/macho_utilities.cc
core/deps/breakpad/src/common/mac/macho_utilities.h
core/deps/breakpad/src/common/mac/macho_walker.cc
core/deps/breakpad/src/common/mac/macho_walker.h
core/deps/breakpad/src/common/mac/string_utilities.cc
core/deps/breakpad/src/common/mac/string_utilities.h
)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/core/deps/breakpad/src)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_BREAKPAD)
add_custom_target(dump_syms COMMAND xcodebuild -project ${CMAKE_CURRENT_SOURCE_DIR}/core/deps/breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj -target dump_syms -configuration Release CONFIGURATION_BUILD_DIR=${CMAKE_CURRENT_SOURCE_DIR}/build/breakpad)
ADD_DEPENDENCIES(${PROJECT_NAME} dump_syms)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND sleep 20
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build/breakpad/dump_syms
-a x86_64
-g ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/Flycast.app.dSYM
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/Flycast.app/Contents/MacOS/Flycast > Flycast.sym
COMMAND mkdir -p ../symbols/Flycast/`head -1 Flycast.sym | awk '{ print $4 }'`
COMMAND mv Flycast.sym ../symbols/Flycast/`head -1 Flycast.sym | awk '{ print $4 }'`
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build/breakpad/dump_syms
-a arm64
-g ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/Flycast.app.dSYM
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/Flycast.app/Contents/MacOS/Flycast > Flycast.sym
COMMAND mkdir -p ../symbols/Flycast/`head -1 Flycast.sym | awk '{ print $4 }'`
COMMAND mv Flycast.sym ../symbols/Flycast/`head -1 Flycast.sym | awk '{ print $4 }'`
)
endif()
endif()
if(USE_OPENMP)
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
if(MINGW)
target_link_libraries(${PROJECT_NAME} PRIVATE "-static -lgomp -lpthread")
target_compile_options(${PROJECT_NAME} PRIVATE -fopenmp)
elseif(ANDROID)
# Reference: https://android.googlesource.com/platform/ndk/+/refs/heads/master/tests/device/openmp/CMakeLists.txt
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_OPTIONS -fopenmp)
target_link_libraries(${PROJECT_NAME} PRIVATE -fopenmp -static-openmp)
elseif(APPLE)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenMP::OpenMP_CXX -static-openmp)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE OpenMP::OpenMP_CXX)
endif()
endif()
endif()
option(BUILD_SHARED_LIBS "Build shared library" OFF)
set(XXHASH_BUILD_XXHSUM OFF CACHE BOOL "Build the xxhsum binary")
add_subdirectory(core/deps/xxHash/cmake_unofficial)
target_link_libraries(${PROJECT_NAME} PRIVATE xxHash::xxhash)
option(BUILD_SHARED_LIBS "Build shared library" OFF)
add_subdirectory(core/deps/glm)
target_link_libraries(${PROJECT_NAME} PRIVATE glm::glm)
if(USE_VULKAN)
option(BUILD_EXTERNAL "Build external dependencies in /External" OFF)
add_subdirectory(core/deps/glslang EXCLUDE_FROM_ALL)
target_link_libraries(${PROJECT_NAME} PRIVATE SPIRV)
endif()
if(NOT LIBRETRO)
find_package(ALSA)
if(ALSA_FOUND AND NOT ANDROID)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_ALSA)
target_include_directories(${PROJECT_NAME} PRIVATE ${ALSA_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE ${ALSA_LIBRARIES})
endif()
if(MINGW)
target_link_libraries(${PROJECT_NAME} PRIVATE "-static-libgcc -static-libstdc++")
endif()
if(NOT ANDROID AND NOT IOS)
if(APPLE)
# Patch SDL
execute_process(COMMAND git apply -p1 ${CMAKE_CURRENT_SOURCE_DIR}/core/deps/patches/SDL.patch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/core/deps/SDL)
else()
find_package(SDL2)
endif()
if(NOT SDL2_FOUND)
add_subdirectory(core/deps/SDL EXCLUDE_FROM_ALL)
if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
target_compile_definitions(SDL2-static PRIVATE HAVE_LIBC)
endif()
set(SDL2_FOUND 1)
endif()
if((APPLE OR WIN32 OR VITA) AND TARGET SDL2::SDL2-static)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2-static)
elseif(TARGET SDL2::SDL2)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2)
else()
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES})
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_SDL USE_SDL_AUDIO)
target_sources(${PROJECT_NAME} PRIVATE core/sdl/sdl.cpp core/sdl/sdl.h core/sdl/sdl_gamepad.h core/sdl/sdl_keyboard.h)
endif()
find_package(ZLIB)
if(TARGET ZLIB::ZLIB AND NOT ANDROID AND (NOT WIN32 OR WINDOWS_STORE))
set(WITH_SYSTEM_ZLIB ON CACHE BOOL "Use system provided zlib library")
target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB)
endif()
find_package(Lua)
if(NOT APPLE AND LUA_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_LUA)
target_include_directories(${PROJECT_NAME} PRIVATE ${LUA_INCLUDE_DIR} core/deps/luabridge/Source)
list(TRANSFORM LUA_LIBRARIES REPLACE "\.dll" "")
target_link_libraries(${PROJECT_NAME} PRIVATE ${LUA_LIBRARIES})
endif()
endif()
add_subdirectory(core/deps/libchdr EXCLUDE_FROM_ALL)
target_link_libraries(${PROJECT_NAME} PRIVATE chdr-static)
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/libchdr/include)
if(NOT WITH_SYSTEM_ZLIB)
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/core/deps/libchdr/deps/zlib-1.2.11")
target_link_libraries(${PROJECT_NAME} PRIVATE zlib)
# help libzip find the package
set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/core/deps/libchdr/deps/zlib-1.2.11")
cmake_policy(SET CMP0026 OLD)
get_target_property(ZLIB_LIBRARY zlib LOCATION)
endif()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND AND NOT ANDROID AND NOT APPLE AND NOT LIBRETRO)
pkg_check_modules(AO IMPORTED_TARGET ao)
if(AO_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_LIBAO)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::AO)
endif()
if(NOT SDL2_FOUND)
pkg_check_modules(LIBEVDEV IMPORTED_TARGET libevdev)
if(LIBEVDEV_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_EVDEV)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBEVDEV)
pkg_check_modules(LIBUDEV IMPORTED_TARGET libudev)
if(LIBUDEV_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_UDEV)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBUDEV)
endif()
endif()
endif()
pkg_check_modules(LIBPULSE IMPORTED_TARGET libpulse)
if(LIBPULSE_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_PULSEAUDIO)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBPULSE)
endif()
if(USE_HOST_LIBZIP)
pkg_check_modules(LIBZIP IMPORTED_TARGET libzip)
if(LIBZIP_FOUND)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBZIP)
endif()
endif()
if(ENABLE_OPROFILE)
target_compile_definitions(${PROJECT_NAME} PRIVATE DYNA_OPROF)
target_link_libraries(${PROJECT_NAME} PRIVATE opagent)
endif()
find_package(MiniUPnPc)
if (MINIUPNP_FOUND)
target_include_directories(${PROJECT_NAME} PRIVATE ${MINIUPNP_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE ${MINIUPNP_LIBRARIES})
endif()
endif()
if(NINTENDO_SWITCH AND USE_GLES)
pkg_check_modules(GLESV2 IMPORTED_TARGET glesv2)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::GLESV2)
endif()
if(VITA)
target_link_libraries(${PROJECT_NAME} PRIVATE vitaGL vitashark SceShaccCg_stub SceShaccCgExt taihen_stub mathneon)
endif()
if(UNIX AND NOT APPLE AND NOT ANDROID)
add_definitions(
-DFLYCAST_DATADIR="${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/"
-DFLYCAST_SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}/${PROJECT_NAME}/"
)
if(USE_GLES2)
target_compile_definitions(${PROJECT_NAME} PRIVATE GLES GLES2)
if(USE_VIDEOCORE)
target_link_libraries(${PROJECT_NAME} PRIVATE "-lbrcmGLESv2")
target_link_directories(${PROJECT_NAME} PRIVATE "/opt/vc/lib")
else()
target_link_libraries(${PROJECT_NAME} PRIVATE GLESv2)
endif()
elseif(USE_GLES)
target_compile_definitions(${PROJECT_NAME} PRIVATE GLES GLES3)
if(NOT SDL2_FOUND)
target_link_libraries(${PROJECT_NAME} PRIVATE EGL)
endif()
find_library(GLES3_LIBRARIES NAMES GLESv3 GLESv2 NO_CACHE REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE ${GLES3_LIBRARIES})
elseif(USE_OPENGL)
set(OpenGL_GL_PREFERENCE LEGACY)
find_package(OpenGL REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL)
endif()
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*" AND NOT LIBRETRO)
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE False)
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie")
endif()
endif()
if(NOT SDL2_FOUND AND NOT LIBRETRO)
find_package(X11 REQUIRED)
if(X11_FOUND)
target_compile_definitions(${PROJECT_NAME} PRIVATE SUPPORT_X11)
target_include_directories(${PROJECT_NAME} PRIVATE ${X11_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} PRIVATE ${X11_LIBRARIES})
endif()
else()
target_compile_definitions(${PROJECT_NAME} PRIVATE EGL_NO_X11)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_DL_LIBS} rt)
endif()
if(ASAN)
target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=address -static-libasan)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -static-libasan")
endif()
if(ANDROID AND NOT LIBRETRO)
find_package(oboe CONFIG)
if(OBOE_FOUND)
target_link_libraries(${PROJECT_NAME} PRIVATE oboe::oboe)
else()
include("core/deps/oboe/gamesdk.cmake")
add_gamesdk_target(PACKAGE_DIR core/deps/oboe ANDROID_API_LEVEL 28 ANDROID_NDK_VERSION 21.0.0)
target_link_libraries(${PROJECT_NAME} PRIVATE oboe OpenSLES)
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_OBOE)
endif()
target_sources(${PROJECT_NAME} PRIVATE
core/deps/chdpsr/cdipsr.cpp
core/deps/chdpsr/cdipsr.h)
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/nowide/include)
if(NOT MINIUPNP_FOUND)
if(NINTENDO_SWITCH OR VITA)
target_compile_definitions(${PROJECT_NAME} PRIVATE FEAT_NO_MINIUPNPC)
else()
option(UPNPC_BUILD_SHARED "Build shared library" OFF)
option(UPNPC_BUILD_TESTS "Build test executables" OFF)
option(UPNPC_BUILD_SAMPLE "Build sample executables" OFF)
option(UPNPC_NO_INSTALL "Disable installation" ON)
add_subdirectory(core/deps/miniupnpc)
if(WINDOWS_STORE)
get_target_property(miniupnpc-private-defs miniupnpc-private INTERFACE_COMPILE_DEFINITIONS)
list(REMOVE_ITEM miniupnpc-private-defs "_WIN32_WINNT=0x0501")
set_property(TARGET miniupnpc-private PROPERTY INTERFACE_COMPILE_DEFINITIONS ${miniupnpc-private-defs})
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE miniupnpc::miniupnpc)
endif()
endif()
if(NOT LIBZIP_FOUND OR NINTENDO_SWITCH OR VITA)
option(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" OFF)
option(ENABLE_GNUTLS "Enable use of GnuTLS" OFF)
option(ENABLE_MBEDTLS "Enable use of mbed TLS" OFF)
option(ENABLE_OPENSSL "Enable use of OpenSSL" OFF)
option(ENABLE_WINDOWS_CRYPTO "Enable use of Windows cryptography libraries" OFF)
option(ENABLE_BZIP2 "Enable use of BZip2" OFF)
option(ENABLE_LZMA "Enable use of LZMA" OFF)
option(ENABLE_ZSTD "Enable use of Zstandard" OFF)
option(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" OFF)
option(BUILD_REGRESS "Build regression tests" OFF)
option(BUILD_EXAMPLES "Build examples" OFF)
option(BUILD_DOC "Build documentation" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(LIBZIP_DO_INSTALL "Install libzip and the related files" OFF)
add_subdirectory(core/deps/libzip)
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/libzip/lib)
target_link_libraries(${PROJECT_NAME} PRIVATE zip)
endif()
if(VITA)
target_link_libraries(${PROJECT_NAME} PRIVATE
-Wl,--whole-archive pthread -Wl,--no-whole-archive
stdc++
kubridge_stub
ScePgf_stub
SceHid_stub
SceAppMgr_stub
SceAppUtil_stub
SceAudio_stub
SceAudioIn_stub
SceDisplay_stub
SceKernelDmacMgr_stub
SceIme_stub
ScePower_stub
SceCtrl_stub
SceGxm_stub
SceVshBridge_stub
)
endif()
if(WIN32)
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/dirent)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/picotcp/include core/deps/picotcp/modules)
target_sources(${PROJECT_NAME} PRIVATE
core/deps/picotcp/include/arch/pico_arm9.h
core/deps/picotcp/include/arch/pico_atsamd21j18.h
core/deps/picotcp/include/arch/pico_avr.h
core/deps/picotcp/include/arch/pico_cortex_m.h
core/deps/picotcp/include/arch/pico_dos.h
core/deps/picotcp/include/arch/pico_esp8266.h
core/deps/picotcp/include/arch/pico_generic_gcc.h
core/deps/picotcp/include/arch/pico_linux.h
core/deps/picotcp/include/arch/pico_mbed.h
core/deps/picotcp/include/arch/pico_msp430.h
core/deps/picotcp/include/arch/pico_msvc.h
core/deps/picotcp/include/arch/pico_none.h
core/deps/picotcp/include/arch/pico_pic24.h
core/deps/picotcp/include/arch/pico_pic32.h
core/deps/picotcp/include/arch/pico_posix.h
core/deps/picotcp/include/heap.h
core/deps/picotcp/include/pico_addressing.h
core/deps/picotcp/include/pico_config.h
core/deps/picotcp/include/pico_constants.h
core/deps/picotcp/include/pico_defines.h
core/deps/picotcp/include/pico_defines_msvc.h
core/deps/picotcp/include/pico_device.h
core/deps/picotcp/include/pico_eth.h
core/deps/picotcp/include/pico_frame.h
core/deps/picotcp/include/pico_md5.h
core/deps/picotcp/include/pico_module_eth.h
core/deps/picotcp/include/pico_protocol.h
core/deps/picotcp/include/pico_queue.h
core/deps/picotcp/include/pico_socket.h
core/deps/picotcp/include/pico_socket_multicast.h
core/deps/picotcp/include/pico_stack.h
core/deps/picotcp/include/pico_tree.h
core/deps/picotcp/modules/pico_arp.c
core/deps/picotcp/modules/pico_dev_ppp.c
core/deps/picotcp/modules/pico_dhcp_common.c
core/deps/picotcp/modules/pico_dhcp_common.h
core/deps/picotcp/modules/pico_dhcp_server.c
core/deps/picotcp/modules/pico_dhcp_server.h
core/deps/picotcp/modules/pico_dns_client.c
core/deps/picotcp/modules/pico_dns_common.c
core/deps/picotcp/modules/pico_ethernet.c
core/deps/picotcp/modules/pico_fragments.c
core/deps/picotcp/modules/pico_icmp4.c
core/deps/picotcp/modules/pico_ipv4.c
core/deps/picotcp/modules/pico_socket_tcp.c
core/deps/picotcp/modules/pico_socket_udp.c
core/deps/picotcp/modules/pico_strings.c
core/deps/picotcp/modules/pico_tcp.c
core/deps/picotcp/modules/pico_udp.c
core/deps/picotcp/stack/pico_device.c
core/deps/picotcp/stack/pico_frame.c
core/deps/picotcp/stack/pico_md5.c
core/deps/picotcp/stack/pico_protocol.c
core/deps/picotcp/stack/pico_socket.c
core/deps/picotcp/stack/pico_socket_multicast.c
core/deps/picotcp/stack/pico_stack.c
core/deps/picotcp/stack/pico_tree.c)
target_compile_definitions(${PROJECT_NAME} PRIVATE _7ZIP_ST)
target_sources(${PROJECT_NAME} PRIVATE core/deps/lzma/7zArcIn.c core/deps/lzma/7zBuf.c core/deps/lzma/7zCrc.c core/deps/lzma/7zCrcOpt.c core/deps/lzma/7zDec.c core/deps/lzma/7zFile.c core/deps/lzma/7zStream.c core/deps/lzma/Alloc.c core/deps/lzma/Bcj2.c core/deps/lzma/Bra86.c core/deps/lzma/Bra.c core/deps/lzma/BraIA64.c core/deps/lzma/CpuArch.c core/deps/lzma/Delta.c core/deps/lzma/LzFind.c core/deps/lzma/Lzma2Dec.c core/deps/lzma/Lzma86Dec.c core/deps/lzma/Lzma86Enc.c core/deps/lzma/LzmaDec.c core/deps/lzma/LzmaEnc.c core/deps/lzma/LzmaLib.c core/deps/lzma/Sort.c)
target_sources(${PROJECT_NAME} PRIVATE core/deps/libelf/elf32.cpp core/deps/libelf/elf64.cpp core/deps/libelf/elf.cpp)
if(NOT LIBRETRO)
target_sources(${PROJECT_NAME} PRIVATE core/deps/imgui/imgui.cpp core/deps/imgui/imgui_demo.cpp core/deps/imgui/imgui_draw.cpp core/deps/imgui/imgui_widgets.cpp)
endif()
target_sources(${PROJECT_NAME} PRIVATE core/deps/xbrz/xbrz.cpp)
target_sources(${PROJECT_NAME} PRIVATE core/deps/md5/md5.cpp)
if(LIBRETRO)
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/libretro-common/include)
target_sources(${PROJECT_NAME} PRIVATE
core/deps/libretro-common/memmap/memalign.c
core/deps/libretro-common/file/file_path.c
core/deps/libretro-common/vfs/vfs_implementation.c
core/deps/libretro-common/encodings/encoding_utf.c
core/deps/libretro-common/compat/compat_strl.c
core/deps/libretro-common/compat/fopen_utf8.c
core/deps/libretro-common/compat/compat_strcasestr.c
core/deps/libretro-common/file/retro_dirent.c
core/deps/libretro-common/string/stdstring.c)
if(USE_OPENGL)
target_sources(${PROJECT_NAME} PRIVATE
core/deps/libretro-common/glsm/glsm.c
core/deps/libretro-common/glsym/rglgen.c)
if(ANDROID OR USE_GLES)
target_sources(${PROJECT_NAME} PRIVATE core/deps/libretro-common/glsym/glsym_es3.c)
elseif(USE_GLES2)
target_sources(${PROJECT_NAME} PRIVATE core/deps/libretro-common/glsym/glsym_es2.c)
else()
target_sources(${PROJECT_NAME} PRIVATE core/deps/libretro-common/glsym/glsym_gl.c)
endif()
endif()
target_sources(${PROJECT_NAME} PRIVATE
shell/libretro/audiostream.cpp
shell/libretro/keyboard_map.h
shell/libretro/libretro_core_option_defines.h
shell/libretro/libretro_core_options_intl.h
shell/libretro/libretro_core_options.h
shell/libretro/libretro.cpp
shell/libretro/LogManager.cpp
shell/libretro/LogManager.h
shell/libretro/option.cpp
shell/libretro/oslib.cpp
shell/libretro/vmu_xhair.cpp)
endif()
target_sources(${PROJECT_NAME} PRIVATE
core/archive/7zArchive.cpp
core/archive/7zArchive.h
core/archive/archive.cpp
core/archive/archive.h
core/archive/rzip.cpp
core/archive/rzip.h
core/archive/ZipArchive.cpp
core/archive/ZipArchive.h
core/cfg/option.h)
if(NOT LIBRETRO)
target_sources(${PROJECT_NAME} PRIVATE
core/cfg/cfg.cpp
core/cfg/cfg.h
core/cfg/cl.cpp
core/cfg/ini.cpp
core/cfg/ini.h
core/cfg/option.cpp)
endif()
target_sources(${PROJECT_NAME} PRIVATE
core/hw/hwreg.h
core/hw/aica/aica.cpp
core/hw/aica/aica.h
core/hw/aica/aica_if.cpp
core/hw/aica/aica_if.h
core/hw/aica/aica_mem.cpp
core/hw/aica/aica_mem.h
core/hw/aica/dsp.cpp
core/hw/aica/dsp.h
core/hw/aica/dsp_arm32.cpp
core/hw/aica/dsp_arm64.cpp
core/hw/aica/dsp_interp.cpp
core/hw/aica/dsp_x64.cpp
core/hw/aica/dsp_x86.cpp
core/hw/aica/sgc_if.cpp
core/hw/aica/sgc_if.h
core/hw/arm7/arm7.cpp
core/hw/arm7/arm7.h
core/hw/arm7/arm_mem.cpp
core/hw/arm7/arm_mem.h
core/hw/arm7/arm7_rec_arm32.cpp
core/hw/arm7/arm7_rec_arm64.cpp
core/hw/arm7/arm7_rec_x64.cpp
core/hw/arm7/arm7_rec.cpp
core/hw/arm7/arm7_rec.h
core/hw/arm7/arm-new.h
core/hw/bba/bba.h
core/hw/bba/bba.cpp
core/hw/bba/rtl8139c.h
core/hw/bba/rtl8139c.cpp
core/hw/flashrom/flashrom.cpp
core/hw/flashrom/flashrom.h
core/hw/gdrom/gdrom_if.h
core/hw/gdrom/gdrom_response.cpp
core/hw/gdrom/gdromv3.cpp
core/hw/gdrom/gdromv3.h
core/hw/holly/holly_intc.cpp
core/hw/holly/holly_intc.h
core/hw/holly/sb.cpp
core/hw/holly/sb.h
core/hw/holly/sb_mem.cpp
core/hw/holly/sb_mem.h
core/hw/maple/maple_cfg.cpp
core/hw/maple/maple_cfg.h
core/hw/maple/maple_devs.cpp
core/hw/maple/maple_devs.h
core/hw/maple/maple_helper.cpp
core/hw/maple/maple_helper.h
core/hw/maple/maple_if.cpp
core/hw/maple/maple_if.h
core/hw/maple/maple_jvs.cpp
core/hw/mem/_vmem.cpp
core/hw/mem/_vmem.h
core/hw/mem/mem_watch.cpp
core/hw/mem/mem_watch.h
core/hw/modem/modem.cpp
core/hw/modem/modem.h
core/hw/modem/modem_regs.h
core/hw/naomi/awave_regs.h
core/hw/naomi/awcartridge.cpp
core/hw/naomi/awcartridge.h
core/hw/naomi/decrypt.cpp
core/hw/naomi/decrypt.h
core/hw/naomi/gdcartridge.cpp
core/hw/naomi/gdcartridge.h
core/hw/naomi/m1cartridge.cpp
core/hw/naomi/m1cartridge.h
core/hw/naomi/m4cartridge.cpp
core/hw/naomi/m4cartridge.h
core/hw/naomi/naomi_cart.cpp
core/hw/naomi/naomi_cart.h
core/hw/naomi/naomi_flashrom.cpp
core/hw/naomi/naomi_flashrom.h
core/hw/naomi/naomi_m3comm.cpp
core/hw/naomi/naomi_m3comm.h
core/hw/naomi/naomi.cpp
core/hw/naomi/naomi.h
core/hw/naomi/naomi_regs.h
core/hw/naomi/naomi_roms.cpp
core/hw/naomi/naomi_roms.h
core/hw/naomi/naomi_roms_input.h
core/hw/naomi/card_reader.h
core/hw/naomi/card_reader.cpp
core/hw/pvr/elan.cpp
core/hw/pvr/elan.h
core/hw/pvr/elan_struct.h
core/hw/pvr/helper_classes.h
core/hw/pvr/pvr.cpp
core/hw/pvr/pvr.h
core/hw/pvr/pvr_mem.cpp
core/hw/pvr/pvr_mem.h
core/hw/pvr/pvr_regs.cpp
core/hw/pvr/pvr_regs.h
core/hw/pvr/pvr_sb_regs.cpp
core/hw/pvr/pvr_sb_regs.h
core/hw/pvr/Renderer_if.cpp
core/hw/pvr/Renderer_if.h
core/hw/pvr/spg.cpp
core/hw/pvr/spg.h
core/hw/pvr/ta_const_df.h
core/hw/pvr/ta.cpp
core/hw/pvr/ta_ctx.cpp
core/hw/pvr/ta_ctx.h
core/hw/pvr/ta.h
core/hw/pvr/ta_structs.h
core/hw/pvr/ta_vtx.cpp
core/hw/sh4/dyna/blockmanager.cpp
core/hw/sh4/dyna/blockmanager.h
core/hw/sh4/dyna/decoder.cpp
core/hw/sh4/dyna/decoder.h
core/hw/sh4/dyna/decoder_opcodes.h
core/hw/sh4/dyna/driver.cpp
core/hw/sh4/dyna/ngen.h
core/hw/sh4/dyna/shil_canonical.h
core/hw/sh4/dyna/shil.cpp
core/hw/sh4/dyna/shil.h
core/hw/sh4/dyna/ssa.cpp
core/hw/sh4/dyna/ssa.h
core/hw/sh4/dyna/ssa_regalloc.h
core/hw/sh4/fsca-table.h
core/hw/sh4/interpr/sh4_fpu.cpp
core/hw/sh4/interpr/sh4_interpreter.cpp
core/hw/sh4/interpr/sh4_opcodes.cpp
core/hw/sh4/interpr/sh4_opcodes.h
core/hw/sh4/modules/bsc.cpp
core/hw/sh4/modules/ccn.cpp
core/hw/sh4/modules/ccn.h
core/hw/sh4/modules/cpg.cpp
core/hw/sh4/modules/dmac.cpp
core/hw/sh4/modules/dmac.h
core/hw/sh4/modules/fastmmu.cpp
core/hw/sh4/modules/intc.cpp
core/hw/sh4/modules/mmu.cpp
core/hw/sh4/modules/mmu.h
core/hw/sh4/modules/modules.h
core/hw/sh4/modules/rtc.cpp
core/hw/sh4/modules/serial.cpp
core/hw/sh4/modules/tmu.cpp
core/hw/sh4/modules/ubc.cpp
core/hw/sh4/modules/wince.h
core/hw/sh4/sh4_cache.h
core/hw/sh4/sh4_core.h
core/hw/sh4/sh4_core_regs.cpp
core/hw/sh4/sh4_if.h
core/hw/sh4/sh4_interpreter.h
core/hw/sh4/sh4_interrupts.cpp
core/hw/sh4/sh4_interrupts.h
core/hw/sh4/sh4_mem.cpp
core/hw/sh4/sh4_mem.h
core/hw/sh4/sh4_mmr.cpp
core/hw/sh4/sh4_mmr.h
core/hw/sh4/sh4_opcode_list.cpp
core/hw/sh4/sh4_opcode_list.h
core/hw/sh4/sh4_rom.cpp
core/hw/sh4/sh4_rom.h
core/hw/sh4/sh4_sched.cpp
core/hw/sh4/sh4_sched.h)
target_sources(${PROJECT_NAME} PRIVATE
core/imgread/cdi.cpp
core/imgread/chd.cpp
core/imgread/common.cpp
core/imgread/common.h
core/imgread/cue.cpp
core/imgread/gdi.cpp
core/imgread/ImgReader.cpp
core/imgread/ioctl.cpp)
if(NOT LIBRETRO)
target_sources(${PROJECT_NAME} PRIVATE
core/input/gamepad.h
core/input/gamepad_device.cpp
core/input/gamepad_device.h
core/input/keyboard_device.h
core/input/mapping.cpp
core/input/mapping.h
core/input/mouse.cpp
core/input/mouse.h)
endif()
if(WIN32)
target_sources(${PROJECT_NAME} PRIVATE
core/windows/comptr.h
core/windows/fault_handler.cpp
core/windows/unwind_info.cpp
core/windows/win_vmem.cpp)
elseif(VITA)
target_sources(${PROJECT_NAME} PRIVATE
core/linux/common.cpp
core/linux/unwind_info.cpp
core/linux/vita_fault_handler.cpp
core/linux/vita_vmem.cpp)
else()
target_sources(${PROJECT_NAME} PRIVATE
core/linux/common.cpp
core/linux/context.cpp
core/linux/posix_vmem.cpp
core/linux/unwind_info.cpp)
if(NINTENDO_SWITCH)
target_sources(${PROJECT_NAME} PRIVATE
core/linux/libnx_vmem.cpp
shell/switch/stubs.c
shell/switch/context_switch.S)
endif()
endif()
if(NOT LIBRETRO)
target_sources(${PROJECT_NAME} PRIVATE
core/linux-dist/dispmanx.cpp
core/linux-dist/dispmanx.h
core/linux-dist/evdev.cpp
core/linux-dist/evdev.h
core/linux-dist/icon.h
core/linux-dist/x11.cpp
core/linux-dist/x11.h
core/linux-dist/x11_keyboard.h)
endif()
target_sources(${PROJECT_NAME} PRIVATE
core/log/BitSet.h
core/log/Log.h
core/log/StringUtil.h)
if(NOT LIBRETRO)
target_sources(${PROJECT_NAME} PRIVATE
core/log/ConsoleListener.h
core/log/ConsoleListenerDroid.cpp
core/log/ConsoleListenerNix.cpp
core/log/ConsoleListenerWin.cpp
core/log/LogManager.cpp
core/log/LogManager.h)
endif()
target_sources(${PROJECT_NAME} PRIVATE
core/network/dns.cpp
core/network/ggpo.cpp
core/network/ggpo.h
core/network/miniupnp.cpp
core/network/miniupnp.h
core/network/naomi_network.cpp
core/network/naomi_network.h
core/network/net_handshake.cpp
core/network/net_handshake.h
core/network/net_platform.h
core/network/picoppp.cpp
core/network/picoppp.h)
if(ANDROID)
target_sources(${PROJECT_NAME} PRIVATE
core/network/ifaddrs.c)
endif()
if(NOT LIBRETRO)
target_sources(${PROJECT_NAME} PRIVATE
core/oslib/audiobackend_alsa.cpp
core/oslib/audiobackend_coreaudio.cpp
core/oslib/audiobackend_directsound.cpp
core/oslib/audiobackend_libao.cpp
core/oslib/audiobackend_null.cpp
core/oslib/audiobackend_oboe.cpp
core/oslib/audiobackend_omx.cpp
core/oslib/audiobackend_oss.cpp
core/oslib/audiobackend_pulseaudio.cpp
core/oslib/audiobackend_sdl2.cpp
core/oslib/audiostream.cpp
core/oslib/oslib.cpp)
endif()
target_sources(${PROJECT_NAME} PRIVATE
core/oslib/audiostream.h
core/oslib/directory.h
core/oslib/host_context.h
core/oslib/oslib.h
core/lua/lua.cpp
core/lua/lua.h)
target_sources(${PROJECT_NAME} PRIVATE