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
|
|
|
)
|
|
|
|
|
2016-07-28 09:01:28 +00:00
|
|
|
if(USE_ICC)
|
|
|
|
set(CommonFlags "${CommonFlags} -restrict")
|
|
|
|
endif()
|
|
|
|
|
2016-02-21 15:17:10 +00:00
|
|
|
set(GSdxFinalFlags ${CommonFlags})
|
2011-02-20 17:01:03 +00:00
|
|
|
|
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
|
|
|
if(LIBLZMA_FOUND)
|
|
|
|
set(GSdxFinalFlags ${GSdxFinalFlags} -DLZMA_SUPPORTED)
|
|
|
|
endif()
|
|
|
|
|
2014-12-12 20:56:01 +00:00
|
|
|
#Clang doesn't support a few common flags that GCC does.
|
|
|
|
if(NOT USE_CLANG)
|
|
|
|
set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6)
|
2013-07-12 21:12:34 +00:00
|
|
|
endif()
|
|
|
|
|
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
|
2013-01-14 09:15:39 +00:00
|
|
|
GLLoader.cpp
|
2013-08-05 20:25:25 +00:00
|
|
|
GLState.cpp
|
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
|
|
|
|
GSDevice.cpp
|
2011-11-16 22:17:37 +00:00
|
|
|
GSDeviceOGL.cpp
|
2014-12-12 20:56:01 +00:00
|
|
|
GSDeviceSW.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDeviceNull.cpp
|
|
|
|
GSDirtyRect.cpp
|
2015-08-06 17:14:00 +00:00
|
|
|
GSDrawingContext.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDrawScanline.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.cpp
|
2011-03-02 18:18:26 +00:00
|
|
|
GSDrawScanlineCodeGenerator.x64.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.x64.avx.cpp
|
2016-11-22 18:00:06 +00:00
|
|
|
GSDrawScanlineCodeGenerator.x64.avx2.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.x86.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.x86.avx.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.x86.avx2.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDump.cpp
|
|
|
|
GSFunctionMap.cpp
|
2016-04-30 10:24:08 +00:00
|
|
|
GSHwHack.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
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
|
|
|
GSRasterizer.cpp
|
|
|
|
GSRenderer.cpp
|
2014-12-01 22:06:24 +00:00
|
|
|
GSRendererCL.cpp
|
2012-01-15 17:25:49 +00:00
|
|
|
GSRendererHW.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSRendererNull.cpp
|
2011-11-16 22:17:37 +00:00
|
|
|
GSRendererOGL.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSRendererSW.cpp
|
2016-09-18 20:40:51 +00:00
|
|
|
GSOsdManager.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSSetting.cpp
|
|
|
|
GSSetupPrimCodeGenerator.cpp
|
2016-11-22 18:00:06 +00:00
|
|
|
GSSetupPrimCodeGenerator.x64.cpp
|
2011-03-02 18:18:26 +00:00
|
|
|
GSSetupPrimCodeGenerator.x64.avx.cpp
|
2016-11-22 18:00:06 +00:00
|
|
|
GSSetupPrimCodeGenerator.x64.avx2.cpp
|
2011-03-02 18:18:26 +00:00
|
|
|
GSSetupPrimCodeGenerator.x86.cpp
|
2016-11-22 18:00:06 +00:00
|
|
|
GSSetupPrimCodeGenerator.x86.avx.cpp
|
|
|
|
GSSetupPrimCodeGenerator.x86.avx2.cpp
|
2013-07-06 10:08:52 +00:00
|
|
|
GSShaderOGL.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSState.cpp
|
|
|
|
GSTables.cpp
|
|
|
|
GSTexture.cpp
|
|
|
|
GSTextureCache.cpp
|
|
|
|
GSTextureCacheSW.cpp
|
2011-11-16 22:17:37 +00:00
|
|
|
GSTextureCacheOGL.cpp
|
|
|
|
GSTextureOGL.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSTextureNull.cpp
|
2014-12-12 20:56:01 +00:00
|
|
|
GSTextureSW.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSUtil.cpp
|
|
|
|
GSVector.cpp
|
|
|
|
GSVertexTrace.cpp
|
|
|
|
GSWnd.cpp
|
|
|
|
GSdx.cpp
|
2017-01-29 09:35:02 +00:00
|
|
|
GSdxResources.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
stdafx.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GSdxHeaders
|
2017-02-16 18:50:33 +00:00
|
|
|
config.h
|
|
|
|
GLLoader.h
|
|
|
|
GLState.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSAlignedClass.h
|
|
|
|
GSBlock.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSCaptureDlg.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSCapture.h
|
|
|
|
GSClut.h
|
|
|
|
GSCodeBuffer.h
|
|
|
|
GSCrc.h
|
|
|
|
GSDevice.h
|
|
|
|
GSDeviceNull.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSDeviceOGL.h
|
|
|
|
GSDeviceSW.h
|
|
|
|
GSDialog.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDirtyRect.h
|
|
|
|
GSDrawingContext.h
|
|
|
|
GSDrawingEnvironment.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSDrawScanlineCodeGenerator.h
|
|
|
|
GSDrawScanline.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDump.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSdx.h
|
|
|
|
GSdxResources.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSFunctionMap.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GS.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSLocalMemory.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSLzma.h
|
|
|
|
GSOsdManager.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
|
|
|
GSRasterizer.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSRendererCL.h
|
|
|
|
GSRendererCS.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSRenderer.h
|
2011-11-16 22:17:37 +00:00
|
|
|
GSRendererHW.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSRendererNull.h
|
2011-11-16 22:17:37 +00:00
|
|
|
GSRendererOGL.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSRendererSW.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSScanlineEnvironment.h
|
|
|
|
GSSetting.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSSettingsDlg.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSSetupPrimCodeGenerator.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSShaderOGL.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSState.h
|
|
|
|
GSTables.h
|
|
|
|
GSTextureCache.h
|
2011-11-16 22:17:37 +00:00
|
|
|
GSTextureCacheOGL.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSTextureCacheSW.h
|
|
|
|
GSTexture.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSTextureNull.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSTextureOGL.h
|
|
|
|
GSTextureSW.h
|
2016-10-31 19:47:21 +00:00
|
|
|
GSThread_CXX11.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSThread.h
|
|
|
|
GSUniformBufferOGL.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSUtil.h
|
|
|
|
GSVector.h
|
2017-02-16 18:50:33 +00:00
|
|
|
GSVertexArrayOGL.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSVertex.h
|
|
|
|
GSVertexHW.h
|
|
|
|
GSVertexList.h
|
|
|
|
GSVertexSW.h
|
|
|
|
GSVertexTrace.h
|
|
|
|
GSWnd.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
|
2013-07-07 16:13:11 +00:00
|
|
|
res/glsl_source.h
|
2011-02-20 17:01:03 +00:00
|
|
|
stdafx.h
|
|
|
|
xbyak/xbyak.h
|
|
|
|
xbyak/xbyak_mnemonic.h
|
|
|
|
xbyak/xbyak_util.h
|
|
|
|
)
|
|
|
|
|
2017-02-16 18:50:33 +00:00
|
|
|
if(Windows)
|
|
|
|
LIST(APPEND GSdxSources
|
|
|
|
GSCaptureDlg.cpp
|
|
|
|
GSDevice11.cpp
|
|
|
|
GSDevice9.cpp
|
|
|
|
GSDeviceDX.cpp
|
|
|
|
GSDialog.cpp
|
|
|
|
GSRendererCS.cpp
|
|
|
|
GSRendererDX11.cpp
|
|
|
|
GSRendererDX9.cpp
|
|
|
|
GSRendererDX.cpp
|
|
|
|
GSSettingsDlg.cpp
|
|
|
|
GSTexture11.cpp
|
|
|
|
GSTexture9.cpp
|
|
|
|
GSTextureCache11.cpp
|
|
|
|
GSTextureCache9.cpp
|
|
|
|
GSTextureFX11.cpp
|
|
|
|
GSTextureFX9.cpp
|
|
|
|
GSTextureFX.cpp
|
|
|
|
GSVertexList.cpp
|
|
|
|
GSVertexSW.cpp
|
|
|
|
GSWndDX.cpp
|
|
|
|
GSWndWGL.cpp
|
|
|
|
PSX/GPUSettingsDlg.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
LIST(APPEND GSdxHeaders
|
|
|
|
GSDevice11.h
|
|
|
|
GSDevice9.h
|
|
|
|
GSDeviceDX.h
|
|
|
|
GSRendererDX11.h
|
|
|
|
GSRendererDX9.h
|
|
|
|
GSRendererDX.h
|
|
|
|
GSTexture11.h
|
|
|
|
GSTexture9.h
|
|
|
|
GSTextureCache11.h
|
|
|
|
GSTextureCache9.h
|
|
|
|
GSWndDX.h
|
|
|
|
GSWndWGL.h
|
|
|
|
PSX/GPUSettingsDlg.h
|
|
|
|
resource.h
|
|
|
|
targetver.h
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
LIST(APPEND GSdxSources
|
|
|
|
GSLinuxDialog.cpp
|
|
|
|
GSWndOGL.cpp
|
|
|
|
GSWndEGL.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
LIST(APPEND GSdxHeaders
|
|
|
|
GSWndEGL.h
|
|
|
|
GSWndOGL.h
|
|
|
|
)
|
|
|
|
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}
|
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)
|
2016-11-18 21:40:52 +00:00
|
|
|
set(GSdxFinalLibs ${GSdxFinalLibs} ${EGL_LIBRARIES})
|
2015-05-11 13:33:40 +00:00
|
|
|
endif()
|
|
|
|
|
2015-05-17 19:57:33 +00:00
|
|
|
if(LIBLZMA_FOUND)
|
2016-11-18 21:40:52 +00:00
|
|
|
set(GSdxFinalLibs ${GSdxFinalLibs} ${LIBLZMA_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
# 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()
|
2011-07-14 09:02:37 +00:00
|
|
|
|
2017-01-29 09:35:02 +00:00
|
|
|
# Note: trying to combine --generate-source and --generate-header doesn't work. It outputs whichever one comes last into the file named by the first
|
|
|
|
execute_process(COMMAND glib-compile-resources --sourcedir res --generate-header --c-name GSdx_res res/gsdx-res.xml --target=GSdxResources.h WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
execute_process(COMMAND glib-compile-resources --sourcedir res --generate-source --c-name GSdx_res res/gsdx-res.xml --target=GSdxResources.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
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)
|