-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
240 lines (217 loc) · 5.42 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
# Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif()
# plugin name
set(Output GSdx-0.1.16)
set(CommonFlags
-fno-operator-names # because Xbyak uses and()/xor()/or()/not() function
-mfpmath=sse
-fno-strict-aliasing
-Wno-unknown-pragmas
-Wno-parentheses
-Wunused-variable # __dummy variable need to be investigated
)
set(OptimizationFlags -O2)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(GSdxFinalFlags ${GSdxFinalFlags} ${CommonFlags} -D_DEBUG)
elseif(CMAKE_BUILD_TYPE STREQUAL Devel)
set(GSdxFinalFlags ${GSdxFinalFlags} ${CommonFlags} ${OptimizationFlags} -D_DEVEL)
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
set(GSdxFinalFlags ${GSdxFinalFlags} ${CommonFlags} ${OptimizationFlags} -W)
endif()
if(XDG_STD)
set(GSdxFinalFlags ${GSdxFinalFlags} -DXDG_STD)
endif()
if(EGL_API AND EGL_FOUND)
set(GSdxFinalFlags ${GSdxFinalFlags} -DEGL_SUPPORTED)
endif()
if(LIBLZMA_FOUND)
set(GSdxFinalFlags ${GSdxFinalFlags} -DLZMA_SUPPORTED)
endif()
#Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG)
set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6)
if (_M_X86_32 AND NOT USE_ASAN)
# Someone need to seriously test the build of GSdx without this option
set(GSdxFinalFlags ${GSdxFinalFlags} -mpreferred-stack-boundary=2)
endif()
endif()
set(GSdxSources
GLLoader.cpp
GLState.cpp
GPU.cpp
GPUDrawScanline.cpp
GPUDrawScanlineCodeGenerator.cpp
GPULocalMemory.cpp
GPURenderer.cpp
GPURendererSW.cpp
GPUSetupPrimCodeGenerator.cpp
GPUState.cpp
GS.cpp
GSAlignedClass.cpp
GSBlock.cpp
GSCapture.cpp
GSClut.cpp
GSCodeBuffer.cpp
GSCrc.cpp
GSDevice.cpp
GSDeviceOGL.cpp
GSDeviceSW.cpp
GSDeviceNull.cpp
GSDirtyRect.cpp
GSDrawScanline.cpp
GSDrawScanlineCodeGenerator.cpp
GSDrawScanlineCodeGenerator.x86.avx.cpp
GSDrawScanlineCodeGenerator.x86.avx2.cpp
GSDrawScanlineCodeGenerator.x64.cpp
GSDrawScanlineCodeGenerator.x86.cpp
GSDrawScanlineCodeGenerator.x64.avx.cpp
GSDump.cpp
GSFunctionMap.cpp
GSLinuxDialog.cpp
GSLocalMemory.cpp
GSLzma.cpp
GSPerfMon.cpp
GSPng.cpp
GSRasterizer.cpp
GSRenderer.cpp
GSRendererCL.cpp
GSRendererHW.cpp
GSRendererNull.cpp
GSRendererOGL.cpp
GSRendererSW.cpp
GSSetting.cpp
GSSetupPrimCodeGenerator.cpp
GSSetupPrimCodeGenerator.x86.avx.cpp
GSSetupPrimCodeGenerator.x86.avx2.cpp
GSSetupPrimCodeGenerator.x64.avx.cpp
GSSetupPrimCodeGenerator.x86.cpp
GSSetupPrimCodeGenerator.x64.cpp
GSShaderOGL.cpp
GSState.cpp
GSTables.cpp
GSTexture.cpp
GSTextureCache.cpp
GSTextureCacheSW.cpp
GSTextureCacheOGL.cpp
GSTextureFXOGL.cpp
GSTextureOGL.cpp
GSTextureNull.cpp
GSTextureSW.cpp
GSThread.cpp
GSUtil.cpp
GSVector.cpp
GSVertexTrace.cpp
GSWnd.cpp
GSWndOGL.cpp
GSWndEGL.cpp
GSdx.cpp
stdafx.cpp
)
set(GSdxHeaders
GPU.h
GPUDrawScanline.h
GPUDrawScanlineCodeGenerator.h
GPUDrawingEnvironment.h
GPULocalMemory.h
GPURenderer.h
GPURendererSW.h
GPUScanlineEnvironment.h
GPUSetupPrimCodeGenerator.h
GPUState.h
GPUVertex.h
GS.h
GSAlignedClass.h
GSBlock.h
GSCapture.h
GSClut.h
GSCodeBuffer.h
GSCrc.h
GSDevice.h
GSDeviceOGL.h
GSDeviceNull.h
GSDirtyRect.h
GSDrawScanline.h
GSDrawScanlineCodeGenerator.h
GSDrawingContext.h
GSDrawingEnvironment.h
GSDump.h
GSFunctionMap.h
GSLinuxLogo.h
GSLocalMemory.h
GSPerfMon.h
GSRasterizer.h
GSRenderer.h
GSRendererNull.h
GSRendererSW.h
GSRendererHW.h
GSRendererOGL.h
GSScanlineEnvironment.h
GSSetting.h
GSSetupPrimCodeGenerator.h
GSState.h
GSTables.h
GSTexture.h
GSTextureCache.h
GSTextureCacheSW.h
GSTextureCacheOGL.h
GSTextureNull.h
GSThread.h
GSUtil.h
GSVector.h
GSVertex.h
GSVertexHW.h
GSVertexList.h
GSVertexSW.h
GSVertexTrace.h
GSWnd.h
GSWndOGL.h
GSWndEGL.h
GSdx.h
res/glsl_source.h
stdafx.h
xbyak/xbyak.h
xbyak/xbyak_bin2hex.h
xbyak/xbyak_mnemonic.h
xbyak/xbyak_util.h
)
set(GSdxFinalSources
${GSdxSources}
${GSdxHeaders}
)
set(GSdxFinalLibs
${X11_LIBRARIES}
)
set(GSdxFinalLibs ${GSdxFinalLibs}
${OPENGL_LIBRARIES}
${GTK2_LIBRARIES}
${LIBC_LIBRARIES}
${PNG_LIBRARY}
)
if(EGL_API AND EGL_FOUND)
set(GSdxFinalLibs ${GSdxFinalLibs}
${EGL_LIBRARIES}
)
endif()
if(LIBLZMA_FOUND)
set(GSdxFinalLibs ${GSdxFinalLibs}
${LIBLZMA_LIBRARIES}
)
endif()
# Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL
if (REBUILD_SHADER)
add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)
endif()
add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
################################### Replay Loader
if(BUILD_REPLAY_LOADERS)
set(Replay pcsx2_GSReplayLoader)
set(GSdxReplayLoaderFinalSources
${GSdxFinalSources}
linux_replay.cpp
)
add_pcsx2_executable(${Replay} "${GSdxReplayLoaderFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
endif(BUILD_REPLAY_LOADERS)