2011-02-20 17:01:03 +00:00
|
|
|
# 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")
|
2014-07-15 23:18:59 +00:00
|
|
|
endif()
|
2011-02-20 17:01:03 +00:00
|
|
|
|
|
|
|
|
2016-04-07 19:46:42 +00:00
|
|
|
# plugin name (no version number to ease future version bump and bisect)
|
|
|
|
set(Output GSdx)
|
2011-02-20 17:01:03 +00:00
|
|
|
|
|
|
|
set(CommonFlags
|
2014-04-13 08:06:28 +00:00
|
|
|
-fno-operator-names # because Xbyak uses and()/xor()/or()/not() function
|
2014-04-18 21:39:12 +00:00
|
|
|
-Wno-unknown-pragmas
|
|
|
|
-Wno-parentheses
|
2014-07-11 21:33:09 +00:00
|
|
|
-Wunused-variable # __dummy variable need to be investigated
|
2011-02-20 17:01:03 +00:00
|
|
|
)
|
|
|
|
|
2018-12-09 10:35:49 +00:00
|
|
|
# The next two need to be looked at, but spam really badly in gcc 8.
|
|
|
|
# Largely class alignment in GSDevice.h and memcpy in GSVector*.h.
|
|
|
|
if(GCC_VERSION VERSION_EQUAL "8.0" OR GCC_VERSION VERSION_GREATER "8.0")
|
|
|
|
set(CommonFlags
|
|
|
|
${CommonFlags}
|
|
|
|
-Wno-class-memaccess
|
|
|
|
-Wno-packed-not-aligned
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-07-28 09:01:28 +00:00
|
|
|
if(USE_ICC)
|
2017-05-08 07:37:13 +00:00
|
|
|
set(CommonFlags "${CommonFlags} -restrict")
|
2016-07-28 09:01:28 +00:00
|
|
|
endif()
|
|
|
|
|
2017-05-12 17:38:51 +00:00
|
|
|
set(GSdxFinalFlags ${CommonFlags})
|
|
|
|
|
2017-05-11 21:14:06 +00:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
# Newer version default to a correct ABI
|
|
|
|
if (${GCC_VERSION} VERSION_LESS "5.1")
|
|
|
|
set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-06-12 18:14:01 +00:00
|
|
|
if(XDG_STD)
|
2014-12-12 20:56:01 +00:00
|
|
|
set(GSdxFinalFlags ${GSdxFinalFlags} -DXDG_STD)
|
2014-07-15 23:18:59 +00:00
|
|
|
endif()
|
2012-06-12 18:14:01 +00:00
|
|
|
|
2015-05-11 13:33:40 +00:00
|
|
|
if(EGL_API AND EGL_FOUND)
|
|
|
|
set(GSdxFinalFlags ${GSdxFinalFlags} -DEGL_SUPPORTED)
|
|
|
|
endif()
|
|
|
|
|
2015-05-17 19:57:33 +00:00
|
|
|
|
2017-02-03 22:30:25 +00:00
|
|
|
if(OPENCL_API)
|
|
|
|
set(GSdxFinalFlags ${GSdxFinalFlags} -DENABLE_OPENCL)
|
|
|
|
endif()
|
|
|
|
|
2011-02-20 17:01:03 +00:00
|
|
|
set(GSdxSources
|
2016-03-28 06:00:48 +00:00
|
|
|
PSX/GPU.cpp
|
|
|
|
PSX/GPUDrawScanline.cpp
|
|
|
|
PSX/GPUDrawScanlineCodeGenerator.cpp
|
|
|
|
PSX/GPULocalMemory.cpp
|
|
|
|
PSX/GPURenderer.cpp
|
|
|
|
PSX/GPURendererSW.cpp
|
|
|
|
PSX/GPUSetupPrimCodeGenerator.cpp
|
|
|
|
PSX/GPUState.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GS.cpp
|
|
|
|
GSAlignedClass.cpp
|
|
|
|
GSBlock.cpp
|
|
|
|
GSCapture.cpp
|
|
|
|
GSClut.cpp
|
|
|
|
GSCodeBuffer.cpp
|
|
|
|
GSCrc.cpp
|
2015-08-06 17:14:00 +00:00
|
|
|
GSDrawingContext.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDump.cpp
|
|
|
|
GSLocalMemory.cpp
|
2016-03-28 06:00:48 +00:00
|
|
|
GSLzma.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSPerfMon.cpp
|
2015-05-16 10:33:58 +00:00
|
|
|
GSPng.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSState.cpp
|
|
|
|
GSTables.cpp
|
|
|
|
GSUtil.cpp
|
|
|
|
GSVector.cpp
|
|
|
|
GSdx.cpp
|
2017-01-29 09:35:02 +00:00
|
|
|
GSdxResources.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
stdafx.cpp
|
2018-11-16 18:41:37 +00:00
|
|
|
Renderers/Common/GSDevice.cpp
|
|
|
|
Renderers/Common/GSDirtyRect.cpp
|
|
|
|
Renderers/Common/GSFunctionMap.cpp
|
|
|
|
Renderers/Common/GSOsdManager.cpp
|
|
|
|
Renderers/Common/GSRenderer.cpp
|
|
|
|
Renderers/Common/GSTexture.cpp
|
|
|
|
Renderers/Common/GSVertexTrace.cpp
|
|
|
|
Renderers/Null/GSDeviceNull.cpp
|
|
|
|
Renderers/Null/GSRendererNull.cpp
|
|
|
|
Renderers/Null/GSTextureNull.cpp
|
|
|
|
Renderers/HW/GSHwHack.cpp
|
|
|
|
Renderers/HW/GSRendererHW.cpp
|
2019-02-11 16:43:59 +00:00
|
|
|
Renderers/HW/GSTextureCache.cpp
|
2018-11-16 18:41:37 +00:00
|
|
|
Renderers/SW/GSDrawScanline.cpp
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.cpp
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp
|
|
|
|
Renderers/SW/GSRasterizer.cpp
|
|
|
|
Renderers/SW/GSRendererSW.cpp
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.cpp
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp
|
|
|
|
Renderers/SW/GSTextureCacheSW.cpp
|
|
|
|
Renderers/SW/GSTextureSW.cpp
|
|
|
|
Renderers/OpenGL/GLLoader.cpp
|
|
|
|
Renderers/OpenGL/GLState.cpp
|
|
|
|
Renderers/OpenGL/GSDeviceOGL.cpp
|
|
|
|
Renderers/OpenGL/GSRendererOGL.cpp
|
|
|
|
Renderers/OpenGL/GSShaderOGL.cpp
|
|
|
|
Renderers/OpenGL/GSTextureCacheOGL.cpp
|
|
|
|
Renderers/OpenGL/GSTextureOGL.cpp
|
|
|
|
Renderers/OpenCL/GSRendererCL.cpp
|
|
|
|
Window/GSSetting.cpp
|
|
|
|
Window/GSWnd.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(GSdxHeaders
|
2017-02-16 18:50:33 +00:00
|
|
|
config.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSAlignedClass.h
|
|
|
|
GSBlock.h
|
|
|
|
GSCapture.h
|
|
|
|
GSClut.h
|
|
|
|
GSCodeBuffer.h
|
|
|
|
GSCrc.h
|
|
|
|
GSDrawingContext.h
|
|
|
|
GSDrawingEnvironment.h
|
|
|
|
GSDump.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSdx.h
|
|
|
|
GSdxResources.h
|
|
|
|
GS.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSLocalMemory.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSLzma.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSPerfMon.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSPng.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSState.h
|
|
|
|
GSTables.h
|
2016-10-31 19:47:21 +00:00
|
|
|
GSThread_CXX11.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSThread.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSUtil.h
|
|
|
|
GSVector.h
|
2017-03-18 08:58:01 +00:00
|
|
|
GSVector4.h
|
|
|
|
GSVector4i.h
|
|
|
|
GSVector8.h
|
|
|
|
GSVector8i.h
|
2018-11-16 18:41:37 +00:00
|
|
|
stdafx.h
|
2017-02-16 18:50:33 +00:00
|
|
|
PSX/GPUDrawingEnvironment.h
|
|
|
|
PSX/GPUDrawScanlineCodeGenerator.h
|
|
|
|
PSX/GPUDrawScanline.h
|
|
|
|
PSX/GPU.h
|
|
|
|
PSX/GPULocalMemory.h
|
|
|
|
PSX/GPURenderer.h
|
|
|
|
PSX/GPURendererSW.h
|
|
|
|
PSX/GPUScanlineEnvironment.h
|
|
|
|
PSX/GPUSetupPrimCodeGenerator.h
|
|
|
|
PSX/GPUState.h
|
|
|
|
PSX/GPUVertex.h
|
2018-11-16 18:41:37 +00:00
|
|
|
Renderers/Common/GSDevice.h
|
|
|
|
Renderers/Common/GSDirtyRect.h
|
|
|
|
Renderers/Common/GSFastList.h
|
|
|
|
Renderers/Common/GSFunctionMap.h
|
|
|
|
Renderers/Common/GSOsdManager.h
|
|
|
|
Renderers/Common/GSRenderer.h
|
|
|
|
Renderers/Common/GSTexture.h
|
|
|
|
Renderers/Common/GSVertex.h
|
|
|
|
Renderers/Common/GSVertexList.h
|
|
|
|
Renderers/Common/GSVertexTrace.h
|
|
|
|
Renderers/Null/GSDeviceNull.h
|
|
|
|
Renderers/Null/GSRendererNull.h
|
|
|
|
Renderers/Null/GSTextureNull.h
|
|
|
|
Renderers/HW/GSRendererHW.h
|
2019-02-11 16:43:59 +00:00
|
|
|
Renderers/HW/GSTextureCache.h
|
2018-11-16 18:41:37 +00:00
|
|
|
Renderers/HW/GSVertexHW.h
|
|
|
|
Renderers/SW/GSDrawScanlineCodeGenerator.h
|
|
|
|
Renderers/SW/GSDrawScanline.h
|
|
|
|
Renderers/SW/GSRasterizer.h
|
|
|
|
Renderers/SW/GSRendererSW.h
|
|
|
|
Renderers/SW/GSScanlineEnvironment.h
|
|
|
|
Renderers/SW/GSSetupPrimCodeGenerator.h
|
|
|
|
Renderers/SW/GSTextureCacheSW.h
|
|
|
|
Renderers/SW/GSTextureSW.h
|
|
|
|
Renderers/SW/GSVertexSW.h
|
|
|
|
Renderers/OpenGL/GLLoader.h
|
|
|
|
Renderers/OpenGL/GLState.h
|
|
|
|
Renderers/OpenGL/GSDeviceOGL.h
|
|
|
|
Renderers/OpenGL/GSRendererOGL.h
|
|
|
|
Renderers/OpenGL/GSShaderOGL.h
|
|
|
|
Renderers/OpenGL/GSTextureCacheOGL.h
|
|
|
|
Renderers/OpenGL/GSTextureOGL.h
|
|
|
|
Renderers/OpenGL/GSUniformBufferOGL.h
|
|
|
|
Renderers/OpenGL/GSVertexArrayOGL.h
|
|
|
|
Renderers/OpenCL/GSRendererCL.h
|
|
|
|
Window/GSCaptureDlg.h
|
|
|
|
Window/GSDialog.h
|
|
|
|
Window/GSSetting.h
|
|
|
|
Window/GSSettingsDlg.h
|
|
|
|
Window/GSWnd.h
|
2011-02-20 17:01:03 +00:00
|
|
|
xbyak/xbyak.h
|
|
|
|
xbyak/xbyak_mnemonic.h
|
|
|
|
xbyak/xbyak_util.h
|
|
|
|
)
|
|
|
|
|
2017-02-16 18:50:33 +00:00
|
|
|
if(Windows)
|
|
|
|
LIST(APPEND GSdxSources
|
2018-11-16 18:41:37 +00:00
|
|
|
Renderers/DX11/GSDevice11.cpp
|
|
|
|
Window/GSDialog.cpp
|
|
|
|
Renderers/DX11/GSRendererDX11.cpp
|
|
|
|
Renderers/DX11/GSTexture11.cpp
|
|
|
|
Renderers/DX11/GSTextureCache11.cpp
|
|
|
|
Renderers/DX11/GSTextureFX11.cpp
|
2017-02-16 18:50:33 +00:00
|
|
|
GSVertexList.cpp
|
2018-11-16 18:41:37 +00:00
|
|
|
Renderers/SW/GSVertexSW.cpp
|
|
|
|
Window/GSCaptureDlg.cpp
|
|
|
|
Window/GSSettingsDlg.cpp
|
|
|
|
Window/GSWndDX.cpp
|
|
|
|
Window/GSWndWGL.cpp
|
2017-02-16 18:50:33 +00:00
|
|
|
PSX/GPUSettingsDlg.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
LIST(APPEND GSdxHeaders
|
2018-11-16 18:41:37 +00:00
|
|
|
Renderers/DX11/GSDevice11.h
|
|
|
|
Renderers/DX11/GSRendererDX11.h
|
|
|
|
Renderers/DX11/GSTexture11.h
|
|
|
|
Renderers/DX11/GSTextureCache11.h
|
|
|
|
Window/GSWndDX.h
|
|
|
|
Window/GSWndWGL.h
|
2017-02-16 18:50:33 +00:00
|
|
|
PSX/GPUSettingsDlg.h
|
|
|
|
resource.h
|
|
|
|
targetver.h
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
LIST(APPEND GSdxSources
|
2018-11-16 18:41:37 +00:00
|
|
|
Window/GSLinuxDialog.cpp
|
|
|
|
Window/GSWndOGL.cpp
|
|
|
|
Window/GSWndEGL.cpp
|
2017-02-16 18:50:33 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
LIST(APPEND GSdxHeaders
|
2018-11-16 18:41:37 +00:00
|
|
|
Window/GSWndEGL.h
|
|
|
|
Window/GSWndOGL.h
|
2017-02-16 18:50:33 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
set(GSdxFinalSources
|
|
|
|
${GSdxSources}
|
|
|
|
${GSdxHeaders}
|
|
|
|
)
|
2012-01-06 21:43:39 +00:00
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
set(GSdxFinalLibs
|
|
|
|
${X11_LIBRARIES}
|
2015-05-16 10:33:58 +00:00
|
|
|
${OPENGL_LIBRARIES}
|
2014-08-04 16:42:40 +00:00
|
|
|
${GTK2_LIBRARIES}
|
|
|
|
${LIBC_LIBRARIES}
|
2016-08-16 19:21:15 +00:00
|
|
|
${PNG_LIBRARIES}
|
2016-09-18 20:40:51 +00:00
|
|
|
${FREETYPE_LIBRARIES}
|
2017-05-08 07:37:13 +00:00
|
|
|
${LIBLZMA_LIBRARIES}
|
2014-08-04 16:42:40 +00:00
|
|
|
)
|
2012-04-16 15:36:16 +00:00
|
|
|
|
2015-05-11 13:33:40 +00:00
|
|
|
if(EGL_API AND EGL_FOUND)
|
2018-05-24 23:12:07 +00:00
|
|
|
set(GSdxFinalLibs ${GSdxFinalLibs} ${EGL_LIBRARIES} ${X11_XCB_LIBRARIES})
|
2015-05-11 13:33:40 +00:00
|
|
|
endif()
|
|
|
|
|
2016-11-18 21:40:52 +00:00
|
|
|
if(USE_VTUNE)
|
2016-12-04 17:46:02 +00:00
|
|
|
set(GSdxFinalLibs ${GSdxFinalLibs} ${VTUNE_LIBRARIES})
|
2015-05-17 19:57:33 +00:00
|
|
|
endif()
|
|
|
|
|
2017-02-03 22:30:25 +00:00
|
|
|
if(OPENCL_FOUND)
|
|
|
|
set(GSdxFinalLibs ${GSdxFinalLibs} ${OPENCL_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2017-04-08 16:14:26 +00:00
|
|
|
set(RESOURCE_FILES
|
|
|
|
res/logo-ogl.bmp
|
|
|
|
res/fxaa.fx
|
|
|
|
res/tfx.cl
|
|
|
|
res/glsl/common_header.glsl
|
|
|
|
res/glsl/convert.glsl
|
|
|
|
res/glsl/interlace.glsl
|
|
|
|
res/glsl/merge.glsl
|
|
|
|
res/glsl/shadeboost.glsl
|
|
|
|
res/glsl/tfx_fs.glsl
|
|
|
|
res/glsl/tfx_vgs.glsl)
|
|
|
|
|
2017-04-12 16:42:04 +00:00
|
|
|
add_custom_glib_res("GSdxResources" "gsdx-res.xml" "GSdx_res" ${RESOURCE_FILES})
|
2017-03-30 16:55:38 +00:00
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
2017-01-29 09:35:02 +00:00
|
|
|
|
2016-03-30 08:19:54 +00:00
|
|
|
if(BUILTIN_GS)
|
|
|
|
add_pcsx2_lib(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
|
|
|
|
else()
|
2016-11-24 20:26:21 +00:00
|
|
|
if (DISABLE_ADVANCE_SIMD)
|
2016-12-31 12:37:43 +00:00
|
|
|
# Don't append -SSE2 on the first build to keep same name as SIMD build
|
|
|
|
add_pcsx2_plugin("${Output}" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
|
2016-11-24 20:26:21 +00:00
|
|
|
add_pcsx2_plugin("${Output}-SSE4" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags} -mssse3 -msse4 -msse4.1")
|
2017-01-30 17:23:52 +00:00
|
|
|
add_pcsx2_plugin("${Output}-AVX2" "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags} -mavx -mavx2 -mbmi -mbmi2")
|
2016-11-24 20:26:21 +00:00
|
|
|
else()
|
|
|
|
add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
|
|
|
|
endif()
|
2016-03-30 08:19:54 +00:00
|
|
|
endif()
|
2012-01-08 21:59:42 +00:00
|
|
|
|
|
|
|
################################### Replay Loader
|
2012-05-01 10:54:52 +00:00
|
|
|
if(BUILD_REPLAY_LOADERS)
|
2014-12-12 20:56:01 +00:00
|
|
|
set(Replay pcsx2_GSReplayLoader)
|
2014-08-04 16:42:40 +00:00
|
|
|
set(GSdxReplayLoaderFinalSources
|
|
|
|
linux_replay.cpp
|
|
|
|
)
|
2016-12-12 17:53:53 +00:00
|
|
|
add_pcsx2_executable(${Replay} "${GSdxReplayLoaderFinalSources}" "${LIBC_LIBRARIES}" "${GSdxFinalFlags}")
|
2012-05-01 10:54:52 +00:00
|
|
|
endif(BUILD_REPLAY_LOADERS)
|