From 286fe4db8c9d1a1fe2ac3058d96ef20a5d53e700 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Mon, 11 May 2015 11:32:13 +0200 Subject: [PATCH] cmake/gsdx: check png++ is installed to support png image Otherwise fallback to bmp file --- cmake/SearchForStuff.cmake | 1 + plugins/GSdx/CMakeLists.txt | 4 ++++ plugins/GSdx/config.h | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 2dd786e551..349edf2b96 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -72,6 +72,7 @@ endif() check_lib(EGL EGL EGL/egl.h) check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h) check_lib(SOUNDTOUCH SoundTouch soundtouch/SoundTouch.h) +check_lib(PNGPP FALSE png++/png.hpp) if(SDL2_API) check_lib(SDL2 SDL2 SDL.h PATH_SUFFIXES SDL2) diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index a646d2ad6c..7c815b6c3b 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -38,6 +38,10 @@ if(XDG_STD) set(GSdxFinalFlags ${GSdxFinalFlags} -DXDG_STD) endif() +if(PNGPP_FOUND) + set(GSdxFinalFlags ${GSdxFinalFlags} -DPNGPP_SUPPORTED) +endif() + #Clang doesn't support a few common flags that GCC does. if(NOT USE_CLANG) set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6) diff --git a/plugins/GSdx/config.h b/plugins/GSdx/config.h index 26efc05486..2e8fe8be9f 100644 --- a/plugins/GSdx/config.h +++ b/plugins/GSdx/config.h @@ -49,7 +49,7 @@ //#define ENABLE_OPENCL #endif -#if defined(ENABLE_OGL_DEBUG) && defined(__linux__) +#if defined(ENABLE_OGL_DEBUG) && defined(__linux__) && defined(PNGPP_SUPPORTED) // Allow to dump texture as PNG (require libpng++). It reduces the size of the dump // and alpha is well supported (on linux) #define ENABLE_OGL_PNG