-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
193 lines (170 loc) · 6.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
# Copyright 2025 Xenon Emulator Project
cmake_minimum_required(VERSION 3.22)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
project(Xenon)
# This function should be passed a list of all files in a target. It will automatically generate file groups
# following the directory hierarchy, so that the layout of the files in IDEs matches the one in the filesystem.
function(create_target_directory_groups target_name)
# Place any files that aren't in the source list in a separate group so that they don't get in the way.
source_group("Other Files" REGULAR_EXPRESSION ".")
get_target_property(target_sources "${target_name}" SOURCES)
foreach(file_name IN LISTS target_sources)
get_filename_component(dir_name "${file_name}" PATH)
# Group names use '\' as a separator even though the entire rest of CMake uses '/'...
string(REPLACE "/" "\\" group_name "${dir_name}")
source_group("${group_name}" FILES "${file_name}")
endforeach()
endfunction()
find_package(fmt 11.1.3 CONFIG)
find_package(SDL3 3.2.4 CONFIG)
find_package(toml11 4.3.0 CONFIG)
add_subdirectory(third_party)
set(Logging
Xenon/Base/Logging/Backend.cpp
Xenon/Base/Logging/Backend.h
Xenon/Base/Logging/Filter.cpp
Xenon/Base/Logging/Filter.h
Xenon/Base/Logging/Formatter.h
Xenon/Base/Logging/Log.h
Xenon/Base/Logging/Log_entry.h
Xenon/Base/Logging/Text_formatter.cpp
Xenon/Base/Logging/Text_formatter.h
Xenon/Base/Logging/Types.h
)
set(Base
${Logging}
Xenon/Base/Alignment.h
Xenon/Base/Arch.h
Xenon/Base/Assert.cpp
Xenon/Base/Assert.h
Xenon/Base/Bounded_threadsafe_queue.h
Xenon/Base/Concepts.h
Xenon/Base/Config.cpp
Xenon/Base/Config.h
Xenon/Base/Error.cpp
Xenon/Base/Error.h
Xenon/Base/Enum.h
Xenon/Base/io_file.cpp
Xenon/Base/io_file.h
Xenon/Base/ntapi.cpp
Xenon/Base/ntapi.h
Xenon/Base/Path_util.cpp
Xenon/Base/Path_util.h
Xenon/Base/Polyfill_thread.h
Xenon/Base/String_util.cpp
Xenon/Base/String_util.h
Xenon/Base/SystemDevice.h
Xenon/Base/Thread.cpp
Xenon/Base/Thread.h
Xenon/Base/Types.h
Xenon/Base/Version.h
)
set(NAND
Xenon/Core/NAND/NAND.cpp
Xenon/Core/NAND/NAND.h
)
set(RAM
Xenon/Core/RAM/RAM.cpp
Xenon/Core/RAM/RAM.h
)
set(RootBus
Xenon/Core/RootBus/RootBus.cpp
Xenon/Core/RootBus/RootBus.h
Xenon/Core/RootBus/HostBridge/HostBridge.cpp
Xenon/Core/RootBus/HostBridge/HostBridge.h
Xenon/Core/RootBus/HostBridge/PCIe.h
Xenon/Core/RootBus/HostBridge/PCIBridge/AUDIOCTRLLR/AudioController.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/AUDIOCTRLLR/AudioController.h
Xenon/Core/RootBus/HostBridge/PCIBridge/EHCI0/EHCI0.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/EHCI0/EHCI0.h
Xenon/Core/RootBus/HostBridge/PCIBridge/EHCI1/EHCI1.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/EHCI1/EHCI1.h
Xenon/Core/RootBus/HostBridge/PCIBridge/ETHERNET/Ethernet.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/ETHERNET/Ethernet.h
Xenon/Core/RootBus/HostBridge/PCIBridge/HDD/HDD.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/HDD/HDD.h
Xenon/Core/RootBus/HostBridge/PCIBridge/ODD/ODD.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/ODD/ODD.h
Xenon/Core/RootBus/HostBridge/PCIBridge/OHCI0/OHCI0.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/OHCI0/OHCI0.h
Xenon/Core/RootBus/HostBridge/PCIBridge/OHCI1/OHCI1.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/OHCI1/OHCI1.h
Xenon/Core/RootBus/HostBridge/PCIBridge/PCIBridge.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/PCIBridge.h
Xenon/Core/RootBus/HostBridge/PCIBridge/PCIBridgeConfig.h
Xenon/Core/RootBus/HostBridge/PCIBridge/PCIDevice.h
Xenon/Core/RootBus/HostBridge/PCIBridge/SFCX/SFCX.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/SFCX/SFCX.h
Xenon/Core/RootBus/HostBridge/PCIBridge/SATA.h
Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC.h
Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/HANA_State.h
Xenon/Core/RootBus/HostBridge/PCIBridge/SMC/SMC_Config.h
Xenon/Core/RootBus/HostBridge/PCIBridge/XMA/XMA.cpp
Xenon/Core/RootBus/HostBridge/PCIBridge/XMA/XMA.h
)
set(XCPU
Xenon/Core/XCPU/Bitfield.h
Xenon/Core/XCPU/Xenon.cpp
Xenon/Core/XCPU/Xenon.h
Xenon/Core/XCPU/XenonReservations.cpp
Xenon/Core/XCPU/XenonReservations.h
Xenon/Core/XCPU/eFuse.h
Xenon/Core/XCPU/IIC/IIC.cpp
Xenon/Core/XCPU/IIC/IIC.h
Xenon/Core/XCPU/Interpreter/PPC_ALU.cpp
Xenon/Core/XCPU/Interpreter/PPC_FPU.cpp
Xenon/Core/XCPU/Interpreter/Interpreter_Helpers.cpp
Xenon/Core/XCPU/Interpreter/PPC_MMU.cpp
Xenon/Core/XCPU/Interpreter/PPC_Instruction.cpp
Xenon/Core/XCPU/Interpreter/PPC_Instruction.h
Xenon/Core/XCPU/Interpreter/PPC_LS.cpp
Xenon/Core/XCPU/Interpreter/PPC_BC.cpp
Xenon/Core/XCPU/Interpreter/PPC_System.cpp
Xenon/Core/XCPU/Interpreter/PPCInterpreter.cpp
Xenon/Core/XCPU/Interpreter/PPCInterpreter.h
Xenon/Core/XCPU/Interpreter/PPCInternal.h
Xenon/Core/XCPU/Interpreter/PPCOpcodes.h
Xenon/Core/XCPU/PostBus/PostBus.cpp
Xenon/Core/XCPU/PostBus/PostBus.h
Xenon/Core/XCPU/PPU/PPU.cpp
Xenon/Core/XCPU/PPU/PPU.h
Xenon/Core/XCPU/PPU/PowerPC.h
)
set(OPENGL
third_party/glad/src/glad.c
)
set(XGPU
${OPENGL}
Xenon/Core/XGPU/XGPU.cpp
Xenon/Core/XGPU/XenosRegisters.h
Xenon/Core/XGPU/XGPU.h
Xenon/Core/XGPU/XGPUConfig.h
)
set(Core
${NAND}
${RAM}
${RootBus}
${XCPU}
${XGPU}
)
add_executable(Xenon
${Base}
${Core}
Xenon/Xe_Main.cpp
)
create_target_directory_groups(Xenon)
# Include OPENGL Directory
include_directories(Xenon third_party/glad/include)
target_include_directories(Xenon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(Xenon PRIVATE fmt::fmt SDL3::SDL3 toml11::toml11)
add_definitions(-DNTDDI_VERSION=0x0A000006 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00)
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
if (WIN32)
target_sources(Xenon PRIVATE Xenon/Xenon.rc)
endif()