From 117bf435b077bbb2fe2339b1dbe7496cda25d749 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 15 Nov 2013 01:09:38 +0000 Subject: [PATCH] Fix GUI-less build. Also potentially OS X. We now require libpng due to our screenshot code relying on it now. WXWidgets links in libpng by itself so it isn't noticed in a wxwidgets build. OS X seems to not have libpng linked in from wxWidgets so just link in libpng at all times. --- CMakeLists.txt | 9 +++++++-- Source/Core/VideoCommon/CMakeLists.txt | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7123f23d7..d350fdeb2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -524,11 +524,16 @@ else() set(LZO lzo2) endif() -if(ANDROID) +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID) + check_lib(PNG png png.h QUIET) +endif() +if (PNG_FOUND) + message("Using shared libpng") +else() message("Using static libpng from Externals") add_subdirectory(Externals/libpng) include_directories(Externals/libpng) - set(PNG libpng) + set(PNG png) endif() if(OPENAL_FOUND) diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index 594624592c..9566712191 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -39,8 +39,7 @@ set(SRCS Src/BPFunctions.cpp Src/XFMemory.cpp Src/XFStructs.cpp Src/memcpy_amd.cpp) - -set(LIBS core) +set(LIBS core png) if(NOT _M_GENERIC) set(SRCS ${SRCS} Src/x64TextureDecoder.cpp