-
-
Notifications
You must be signed in to change notification settings - Fork 264
/
CMakeLists.txt
96 lines (78 loc) · 2.54 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
cmake_minimum_required(VERSION 3.15)
# macOS deployment target needs to be set before 'project' to work
if(APPLE AND NOT TARGET_IOS)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
endif()
project(Play)
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/deps/Dependencies/cmake-modules
${CMAKE_MODULE_PATH}
)
include(Header)
set(BUILD_PLAY ON CACHE BOOL "Build Play! Emulator")
set(BUILD_PSFPLAYER OFF CACHE BOOL "Build PsfPlayer")
set(BUILD_TESTS ON CACHE BOOL "Build Tests")
set(USE_AOT_CACHE OFF CACHE BOOL "Use AOT block cache")
set(BUILD_AOT_CACHE OFF CACHE BOOL "Build AOT block cache (for PsfPlayer only)")
set(BUILD_LIBRETRO_CORE OFF CACHE BOOL "Build Libretro Core")
set(PROJECT_NAME "Play!")
set(PROJECT_Version 0.30)
if(BUILD_TESTS)
enable_testing()
endif()
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/")
execute_process(COMMAND ${GIT_EXECUTABLE} describe --always
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_DESCRIBE_RESULT
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GIT_DESCRIBE_RESULT EQUAL 0)
message("Building for ${GIT_TAG}.")
set(PROJECT_Version ${GIT_TAG})
else()
message("Warning: Failed to obtain Git tag.")
endif()
else()
message("Warning: Not a git repo or git not found.")
endif()
add_definitions(-DPLAY_VERSION="${PROJECT_Version}")
set(PROJECT_LIBS)
include(PrecompiledHeader)
if(BUILD_LIBRETRO_CORE)
if(NOT MSVC)
add_compile_options($<$<NOT:$<COMPILE_LANGUAGE:Swift>>:-fPIC>)
endif()
add_subdirectory(Source/ui_libretro)
endif()
if(BUILD_PLAY)
if(TARGET_PLATFORM_UNIX OR TARGET_PLATFORM_MACOS OR TARGET_PLATFORM_WIN32 OR USE_QT)
add_subdirectory(Source/ui_qt/)
add_subdirectory(tools/ElfView)
endif(TARGET_PLATFORM_UNIX OR TARGET_PLATFORM_MACOS OR TARGET_PLATFORM_WIN32 OR USE_QT)
if(NOT USE_QT)
if(TARGET_PLATFORM_IOS)
add_subdirectory(Source/ui_ios/)
endif(TARGET_PLATFORM_IOS)
if(TARGET_PLATFORM_ANDROID)
add_subdirectory(Source/ui_android/)
endif(TARGET_PLATFORM_ANDROID)
if(TARGET_PLATFORM_JS)
add_subdirectory(Source/ui_js)
endif(TARGET_PLATFORM_JS)
endif()
endif(BUILD_PLAY)
if(BUILD_TESTS)
add_subdirectory(tools/AutoTest/)
add_subdirectory(tools/GsAreaTest/)
add_subdirectory(tools/McServTest/)
add_subdirectory(tools/SpuTest/)
add_subdirectory(tools/VuTest/)
add_subdirectory(deps/Framework/build_cmake/Tests)
endif()
add_subdirectory(tools/NamcoSys147NANDTools)
if(BUILD_PSFPLAYER)
add_subdirectory(tools/PsfPlayer)
endif(BUILD_PSFPLAYER)