From c23f51480e4d05545e06406cfb509ce8fa8f69f8 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Tue, 15 Sep 2015 22:46:51 -0300 Subject: [PATCH 1/7] Add option to shared libzip and libsnappy in CMakeLists.txt. --- CMakeLists.txt | 155 +++++++++++++++++++----------------- CMakeTests/FindLibZip.cmake | 74 +++++++++++++++++ CMakeTests/FindSnappy.cmake | 59 ++++++++++++++ 3 files changed, 217 insertions(+), 71 deletions(-) create mode 100644 CMakeTests/FindLibZip.cmake create mode 100644 CMakeTests/FindSnappy.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c1f5577f4..2b1cd841c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -386,19 +386,27 @@ endif() if(NOT USING_GLES2) include_directories(${OPENGL_INCLUDE_DIR}) + find_package(GLEW) + if(NOT GLEW_FOUND) + add_definitions(-DGLEW_STATIC) + add_library(glew STATIC + ext/native/ext/glew/GL/glew.h + ext/native/ext/glew/GL/glxew.h + ext/native/ext/glew/GL/wglew.h + ext/native/ext/glew/glew.c) + target_link_libraries(glew ${OPENGL_LIBRARIES}) + include_directories(ext/native/ext/glew) + set(GLEW_LIBRARIES glew) + endif() +else() + find_package(X11) +endif() - add_definitions(-DGLEW_STATIC) - add_library(glew STATIC - ext/native/ext/glew/GL/glew.h - ext/native/ext/glew/GL/glxew.h - ext/native/ext/glew/GL/wglew.h - ext/native/ext/glew/glew.c) - target_link_libraries(glew ${OPENGL_LIBRARIES}) - include_directories(ext/native/ext/glew) - set(GLEW_LIBRARIES glew) +find_package(Snappy) +if(NOT SNAPPY_FOUND) + add_subdirectory(ext/snappy) endif() -add_subdirectory(ext/snappy) add_subdirectory(ext/udis86) add_library(vjson STATIC @@ -618,7 +626,9 @@ include_directories(ext/cityhash) if (NOT MSVC) # These can be fast even for debug. - set_target_properties(snappy PROPERTIES COMPILE_FLAGS "-O3") + if(NOT SNAPPY_FOUND) + set_target_properties(snappy PROPERTIES COMPILE_FLAGS "-O3") + endif() set_target_properties(udis86 PROPERTIES COMPILE_FLAGS "-O3") set_target_properties(cityhash PROPERTIES COMPILE_FLAGS "-O3") if(NOT ZLIB_FOUND) @@ -627,65 +637,68 @@ if (NOT MSVC) endif() -add_library(libzip STATIC - ext/native/ext/libzip/zip.h - ext/native/ext/libzip/mkstemp.c - ext/native/ext/libzip/zip_add.c - ext/native/ext/libzip/zip_add_dir.c - ext/native/ext/libzip/zip_close.c - ext/native/ext/libzip/zip_delete.c - ext/native/ext/libzip/zip_dirent.c - ext/native/ext/libzip/zip_entry_free.c - ext/native/ext/libzip/zip_entry_new.c - ext/native/ext/libzip/zip_err_str.c - ext/native/ext/libzip/zip_error.c - ext/native/ext/libzip/zip_error_clear.c - ext/native/ext/libzip/zip_error_get.c - ext/native/ext/libzip/zip_error_get_sys_type.c - ext/native/ext/libzip/zip_error_strerror.c - ext/native/ext/libzip/zip_error_to_str.c - ext/native/ext/libzip/zip_fclose.c - ext/native/ext/libzip/zip_file_error_clear.c - ext/native/ext/libzip/zip_file_error_get.c - ext/native/ext/libzip/zip_file_get_offset.c - ext/native/ext/libzip/zip_file_strerror.c - ext/native/ext/libzip/zip_filerange_crc.c - ext/native/ext/libzip/zip_fopen.c - ext/native/ext/libzip/zip_fopen_index.c - ext/native/ext/libzip/zip_fread.c - ext/native/ext/libzip/zip_free.c - ext/native/ext/libzip/zip_get_archive_comment.c - ext/native/ext/libzip/zip_get_archive_flag.c - ext/native/ext/libzip/zip_get_file_comment.c - ext/native/ext/libzip/zip_get_name.c - ext/native/ext/libzip/zip_get_num_files.c - ext/native/ext/libzip/zip_memdup.c - ext/native/ext/libzip/zip_name_locate.c - ext/native/ext/libzip/zip_new.c - ext/native/ext/libzip/zip_open.c - ext/native/ext/libzip/zip_rename.c - ext/native/ext/libzip/zip_replace.c - ext/native/ext/libzip/zip_set_archive_comment.c - ext/native/ext/libzip/zip_set_archive_flag.c - ext/native/ext/libzip/zip_set_file_comment.c - ext/native/ext/libzip/zip_set_name.c - ext/native/ext/libzip/zip_source_buffer.c - ext/native/ext/libzip/zip_source_file.c - ext/native/ext/libzip/zip_source_filep.c - ext/native/ext/libzip/zip_source_free.c - ext/native/ext/libzip/zip_source_function.c - ext/native/ext/libzip/zip_source_zip.c - ext/native/ext/libzip/zip_stat.c - ext/native/ext/libzip/zip_stat_index.c - ext/native/ext/libzip/zip_stat_init.c - ext/native/ext/libzip/zip_strerror.c - ext/native/ext/libzip/zip_unchange.c - ext/native/ext/libzip/zip_unchange_all.c - ext/native/ext/libzip/zip_unchange_archive.c - ext/native/ext/libzip/zip_unchange_data.c) -target_link_libraries(libzip ${ZLIB_LIBRARY}) -include_directories(ext/native/ext/libzip) -set(LIBZIP_LIBRARY libzip) +find_package(LibZip) +if(NOT LIBZIP_FOUND) + add_library(libzip STATIC + ext/native/ext/libzip/zip.h + ext/native/ext/libzip/mkstemp.c + ext/native/ext/libzip/zip_add.c + ext/native/ext/libzip/zip_add_dir.c + ext/native/ext/libzip/zip_close.c + ext/native/ext/libzip/zip_delete.c + ext/native/ext/libzip/zip_dirent.c + ext/native/ext/libzip/zip_entry_free.c + ext/native/ext/libzip/zip_entry_new.c + ext/native/ext/libzip/zip_err_str.c + ext/native/ext/libzip/zip_error.c + ext/native/ext/libzip/zip_error_clear.c + ext/native/ext/libzip/zip_error_get.c + ext/native/ext/libzip/zip_error_get_sys_type.c + ext/native/ext/libzip/zip_error_strerror.c + ext/native/ext/libzip/zip_error_to_str.c + ext/native/ext/libzip/zip_fclose.c + ext/native/ext/libzip/zip_file_error_clear.c + ext/native/ext/libzip/zip_file_error_get.c + ext/native/ext/libzip/zip_file_get_offset.c + ext/native/ext/libzip/zip_file_strerror.c + ext/native/ext/libzip/zip_filerange_crc.c + ext/native/ext/libzip/zip_fopen.c + ext/native/ext/libzip/zip_fopen_index.c + ext/native/ext/libzip/zip_fread.c + ext/native/ext/libzip/zip_free.c + ext/native/ext/libzip/zip_get_archive_comment.c + ext/native/ext/libzip/zip_get_archive_flag.c + ext/native/ext/libzip/zip_get_file_comment.c + ext/native/ext/libzip/zip_get_name.c + ext/native/ext/libzip/zip_get_num_files.c + ext/native/ext/libzip/zip_memdup.c + ext/native/ext/libzip/zip_name_locate.c + ext/native/ext/libzip/zip_new.c + ext/native/ext/libzip/zip_open.c + ext/native/ext/libzip/zip_rename.c + ext/native/ext/libzip/zip_replace.c + ext/native/ext/libzip/zip_set_archive_comment.c + ext/native/ext/libzip/zip_set_archive_flag.c + ext/native/ext/libzip/zip_set_file_comment.c + ext/native/ext/libzip/zip_set_name.c + ext/native/ext/libzip/zip_source_buffer.c + ext/native/ext/libzip/zip_source_file.c + ext/native/ext/libzip/zip_source_filep.c + ext/native/ext/libzip/zip_source_free.c + ext/native/ext/libzip/zip_source_function.c + ext/native/ext/libzip/zip_source_zip.c + ext/native/ext/libzip/zip_stat.c + ext/native/ext/libzip/zip_stat_index.c + ext/native/ext/libzip/zip_stat_init.c + ext/native/ext/libzip/zip_strerror.c + ext/native/ext/libzip/zip_unchange.c + ext/native/ext/libzip/zip_unchange_all.c + ext/native/ext/libzip/zip_unchange_archive.c + ext/native/ext/libzip/zip_unchange_data.c) + target_link_libraries(libzip) + include_directories(ext/native/ext/libzip) + set(LIBZIP_LIBRARY libzip) +endif() # FindPNG does a few things we don't want. So do it ourselves. Fixed to libpng17 find_path(PNG_PNG_INCLUDE_DIR NAMES "libpng17/png.h") @@ -1019,7 +1032,7 @@ if (LINUX AND NOT ANDROID) SET(RT_LIB rt) endif() -target_link_libraries(native ${LIBZIP_LIBRARY} ${PNG_LIBRARY} rg_etc1 vjson stb_vorbis snappy udis86 ${RT_LIB} ${GLEW_LIBRARIES}) +target_link_libraries(native ${LIBZIP_LIBRARY} ${ZLIB_LIBRARY} ${PNG_LIBRARY} rg_etc1 vjson stb_vorbis snappy udis86 ${RT_LIB} ${GLEW_LIBRARIES}) if(ANDROID) target_link_libraries(native log EGL) diff --git a/CMakeTests/FindLibZip.cmake b/CMakeTests/FindLibZip.cmake new file mode 100644 index 0000000000..778da584f0 --- /dev/null +++ b/CMakeTests/FindLibZip.cmake @@ -0,0 +1,74 @@ +# https://code.google.com/p/osgearth-for-android/source/browse/trunk/CMakeModules/FindLibZip.cmake?r=4 + +# osgEarth - Dynamic map generation toolkit for OpenSceneGraph +# Copyright 2008-2010 Pelican Mapping + +# http://osgearth.org +# git://github.com/gwaldron/osgearth + +# osgEarth is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see + + +# Locate libzip +# This module defines +# LIBZIP_LIBRARY +# LIBZIP_FOUND, if false, do not try to link to libzip +# LIBZIP_INCLUDE_DIR, where to find the headers +# + +FIND_PATH(LIBZIP_INCLUDE_DIR zip.h + $ENV{LIBZIP_DIR}/include + $ENV{LIBZIP_DIR} + $ENV{OSGDIR}/include + $ENV{OSGDIR} + $ENV{OSG_ROOT}/include + ~/Library/Frameworks + /Library/Frameworks + /usr/local/include + /usr/include + /sw/include # Fink + /opt/local/include # DarwinPorts + /opt/csw/include # Blastwave + /opt/include + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include + /usr/freeware/include +) + +FIND_LIBRARY(LIBZIP_LIBRARY + NAMES libzip zip + PATHS + $ENV{LIBZIP_DIR}/lib + $ENV{LIBZIP_DIR} + $ENV{OSGDIR}/lib + $ENV{OSGDIR} + $ENV{OSG_ROOT}/lib + ~/Library/Frameworks + /Library/Frameworks + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib + /usr/freeware/lib64 +) + +SET(LIBZIP_FOUND "NO") +IF(LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR) + SET(LIBZIP_FOUND "YES") +ENDIF(LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBZIP DEFAULT_MSG LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR) diff --git a/CMakeTests/FindSnappy.cmake b/CMakeTests/FindSnappy.cmake new file mode 100644 index 0000000000..2541e97432 --- /dev/null +++ b/CMakeTests/FindSnappy.cmake @@ -0,0 +1,59 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Tries to find Snappy headers and libraries. +# +# Usage of this module as follows: +# +# find_package(Snappy) +# +# Variables used by this module, they can change the default behaviour and need +# to be set before calling find_package: +# +# SNAPPY_ROOT_DIR Set this variable to the root installation of +# Snappy if the module has problems finding +# the proper installation path. +# +# Variables defined by this module: +# +# SNAPPY_FOUND System has Snappy libs/headers +# SNAPPY_LIBRARIES The Snappy libraries +# SNAPPY_INCLUDE_DIR The location of Snappy headers + +find_path(SNAPPY_INCLUDE_DIR + NAMES snappy.h + HINTS ${SNAPPY_ROOT_DIR}/include) + +find_library(SNAPPY_LIBRARIES + NAMES snappy + HINTS ${SNAPPY_ROOT_DIR}/lib) + +set(SNAPPY_FOUND "NO") +if(SNAPPY_LIBRARIES AND SNAPPY_INCLUDE_DIR) + set(SNAPPY_FOUND "YES") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Snappy DEFAULT_MSG + SNAPPY_LIBRARIES + SNAPPY_INCLUDE_DIR) + +mark_as_advanced( + SNAPPY_ROOT_DIR + SNAPPY_LIBRARIES + SNAPPY_INCLUDE_DIR) From 69fa5b179d84a234a9bdba84079150bcea037816 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Tue, 15 Sep 2015 22:47:10 -0300 Subject: [PATCH 2/7] Make build_ppgeatlas.sh executable. --- build_ppgeatlas.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build_ppgeatlas.sh diff --git a/build_ppgeatlas.sh b/build_ppgeatlas.sh old mode 100644 new mode 100755 From 5ec87f345920915d824af7a19e3a4d74b34ee584 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Wed, 16 Sep 2015 00:59:31 -0300 Subject: [PATCH 3/7] Improve detection of for shared libs in both sdl and Qt (zlib, libzip, snappy and glew). --- CMakeLists.txt | 11 ++++++++--- Common/ChunkFile.h | 4 ++++ Core/HLE/sceAdler.cpp | 4 ++++ Core/Util/GameManager.cpp | 4 ++++ Qt/Core.pro | 4 +++- Qt/GPU.pro | 4 +++- Qt/Native.pro | 25 +++++++++++++++---------- Qt/PPSSPP.pro | 18 +++++++++++++++++- Qt/Settings.pri | 12 ++++++++++++ 9 files changed, 70 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b1cd841c3..e7a350667c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -403,8 +403,10 @@ else() endif() find_package(Snappy) -if(NOT SNAPPY_FOUND) - add_subdirectory(ext/snappy) +if(SNAPPY_FOUND) + add_definitions(-DSHARED_SNAPPY) +else() + add_subdirectory(ext/snappy) endif() add_subdirectory(ext/udis86) @@ -583,6 +585,7 @@ endif() find_package(ZLIB) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIR}) + add_definitions(-DSHARED_ZLIB) else() add_library(zlib STATIC ext/zlib/adler32.c @@ -638,7 +641,9 @@ endif() find_package(LibZip) -if(NOT LIBZIP_FOUND) +if(LIBZIP_FOUND) + add_definitions(-DSHARED_LIBZIP) +else() add_library(libzip STATIC ext/native/ext/libzip/zip.h ext/native/ext/libzip/mkstemp.c diff --git a/Common/ChunkFile.h b/Common/ChunkFile.h index 6544567eb4..2ea39c6e48 100644 --- a/Common/ChunkFile.h +++ b/Common/ChunkFile.h @@ -40,7 +40,11 @@ #include "Common.h" #include "FileUtil.h" +#ifdef SHARED_SNAPPY +#include +#else #include "../ext/snappy/snappy-c.h" +#endif #if defined(MACGNUSTD) namespace std { diff --git a/Core/HLE/sceAdler.cpp b/Core/HLE/sceAdler.cpp index 7bb4794b0f..2379a17cf0 100644 --- a/Core/HLE/sceAdler.cpp +++ b/Core/HLE/sceAdler.cpp @@ -15,7 +15,11 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#ifdef SHARED_ZLIB +#include +#else #include "../ext/zlib/zlib.h" +#endif #include "sceAdler.h" #include "Common/Log.h" diff --git a/Core/Util/GameManager.cpp b/Core/Util/GameManager.cpp index d726e2343b..f0e3904063 100644 --- a/Core/Util/GameManager.cpp +++ b/Core/Util/GameManager.cpp @@ -20,7 +20,11 @@ #include #include "file/file_util.h" +#ifdef SHARED_LIBZIP +#include +#else #include "ext/libzip/zip.h" +#endif #include "thread/thread.h" #include "util/text/utf8.h" diff --git a/Qt/Core.pro b/Qt/Core.pro index d7c45ad6cc..f7818145a3 100644 --- a/Qt/Core.pro +++ b/Qt/Core.pro @@ -6,7 +6,9 @@ CONFIG += staticlib include(Settings.pri) INCLUDEPATH += $$P/ $$P/ext/native $$P/Core/MIPS $$P/ext/xbrz -!contains(DEFINES, USING_GLES2): INCLUDEPATH += $$P/ext/native/ext/glew +!exists( /usr/include/GL/glew.h ) { + !contains(DEFINES, USING_GLES2): INCLUDEPATH += $$P/ext/native/ext/glew +} arm { SOURCES += $$P/Core/MIPS/ARM/*.cpp #CoreARM diff --git a/Qt/GPU.pro b/Qt/GPU.pro index cc6af94dcc..a68107c009 100644 --- a/Qt/GPU.pro +++ b/Qt/GPU.pro @@ -7,7 +7,9 @@ CONFIG += staticlib include(Settings.pri) INCLUDEPATH += $$P/ $$P/ext/native -!contains(DEFINES, USING_GLES2): INCLUDEPATH += $$P/ext/native/ext/glew +!exists( /usr/include/GL/glew.h ) { + !contains(DEFINES, USING_GLES2): INCLUDEPATH += $$P/ext/native/ext/glew +} win32 { SOURCES += $$P/Windows/OpenGLBase.cpp diff --git a/Qt/Native.pro b/Qt/Native.pro index 9b853990fa..bbb4995846 100644 --- a/Qt/Native.pro +++ b/Qt/Native.pro @@ -11,10 +11,12 @@ linux-g++:system($$QMAKE_CXX --version | grep "4.6."): DEFINES+=override INCLUDEPATH += $$P/ext/native -!contains(DEFINES,USING_GLES2) { - SOURCES += $$P/ext/native/ext/glew/glew.c - HEADERS += $$P/ext/native/ext/glew/GL/*.h - INCLUDEPATH += $$P/ext/native/ext/glew +!exists( /usr/include/GL/glew.h ) { + !contains(DEFINES,USING_GLES2) { + SOURCES += $$P/ext/native/ext/glew/glew.c + HEADERS += $$P/ext/native/ext/glew/GL/*.h + INCLUDEPATH += $$P/ext/native/ext/glew + } } # RG_ETC1 @@ -41,10 +43,11 @@ HEADERS += $$P/ext/native/ext/stb_vorbis/stb_vorbis.h INCLUDEPATH += $$P/ext/native/ext/stb_vorbis # Snappy - -SOURCES += $$P/ext/snappy/*.cpp -HEADERS += $$P/ext/snappy/*.h -INCLUDEPATH += $$P/ext/snappy +!exists( /usr/include/snappy-c.h ) { + SOURCES += $$P/ext/snappy/*.cpp + HEADERS += $$P/ext/snappy/*.h + INCLUDEPATH += $$P/ext/snappy +} # udis86 @@ -67,8 +70,10 @@ win32|contains(QT_CONFIG, no-zlib) { } # Libzip -SOURCES += $$P/ext/native/ext/libzip/*.c -HEADERS += $$P/ext/native/ext/libzip/*.h +!exists( /usr/include/zip.h ) { + SOURCES += $$P/ext/native/ext/libzip/*.c + HEADERS += $$P/ext/native/ext/libzip/*.h +} # Native diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 2f0d0cf088..32bb2ffab0 100644 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -49,6 +49,18 @@ macx|equals(PLATFORM_NAME, "linux") { } } +exists( /usr/include/GL/glew.h ) { + LIBS += -lGLEW +} + +exists( /usr/include/snappy-c.h ) { + LIBS += -lsnappy +} + +exists( /usr/include/zip.h ) { + LIBS += -lzip +} + unix:contains(QT_CONFIG, system-zlib) { LIBS += -lz } @@ -77,7 +89,11 @@ SOURCES += $$P/UI/*.cpp \ arm:android: SOURCES += $$P/android/jni/ArmEmitterTest.cpp HEADERS += $$P/UI/*.h -INCLUDEPATH += $$P $$P/Common $$P/ext/native $$P/ext/native/ext $$P/ext/native/ext/glew +exists( /usr/include/GL/glew.h ) { + INCLUDEPATH += $$P $$P/Common $$P/ext/native $$P/ext/native/ext +} else { + INCLUDEPATH += $$P $$P/Common $$P/ext/native $$P/ext/native/ext $$P/ext/native/ext/glew +} mobile_platform { !no_assets: RESOURCES += $$P/Qt/assets.qrc diff --git a/Qt/Settings.pri b/Qt/Settings.pri index 8b67d4c576..63cd628992 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -1,6 +1,18 @@ VERSION = 1.0.1.0 DEFINES += USING_QT_UI USE_FFMPEG +exists( /usr/include/snappy-c.h ) { + DEFINES += SHARED_SNAPPY +} + +unix:contains(QT_CONFIG, system-zlib) { + DEFINES += SHARED_ZLIB +} + +exists( /usr/include/zip.h ) { + DEFINES += SHARED_LIBZIP +} + # Global specific win32:CONFIG(release, debug|release): CONFIG_DIR = $$join(OUT_PWD,,,/release) else:win32:CONFIG(debug, debug|release): CONFIG_DIR = $$join(OUT_PWD,,,/debug) From 86051a8f3c534f1b0f8b9860628c05e94291e1d0 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Wed, 16 Sep 2015 01:06:56 -0300 Subject: [PATCH 4/7] Less derp :) --- Qt/PPSSPP.pro | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 32bb2ffab0..b7db5403f4 100644 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -89,10 +89,9 @@ SOURCES += $$P/UI/*.cpp \ arm:android: SOURCES += $$P/android/jni/ArmEmitterTest.cpp HEADERS += $$P/UI/*.h +INCLUDEPATH += $$P $$P/Common $$P/ext/native $$P/ext/native/ext exists( /usr/include/GL/glew.h ) { - INCLUDEPATH += $$P $$P/Common $$P/ext/native $$P/ext/native/ext -} else { - INCLUDEPATH += $$P $$P/Common $$P/ext/native $$P/ext/native/ext $$P/ext/native/ext/glew + INCLUDEPATH += $$P/ext/native/ext/glew } mobile_platform { From 91ff53527263e63987a0b2b5a21675c12a9c336c Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Wed, 16 Sep 2015 01:13:15 -0300 Subject: [PATCH 5/7] Fix atlastool build. --- ext/native/tools/atlastool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/native/tools/atlastool.cpp b/ext/native/tools/atlastool.cpp index 874a28b4f5..c23424174d 100644 --- a/ext/native/tools/atlastool.cpp +++ b/ext/native/tools/atlastool.cpp @@ -188,7 +188,7 @@ struct Image { png_destroy_write_struct(&png_ptr, &info_ptr); } void SaveZIM(const char *zim_name, int zim_format) { - uint8 *image_data = new uint8[width() * height() * 4]; + uint8_t *image_data = new uint8_t[width() * height() * 4]; for (int y = 0; y < height(); y++) { memcpy(image_data + y * width() * 4, &dat[y][0], width() * 4); } From 1c869e460736e558d291843d5761f9b6d24648f0 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Wed, 16 Sep 2015 01:32:23 -0300 Subject: [PATCH 6/7] png17 must be after image, no need of libzip here; fix freetype2 header. --- ext/native/tools/CMakeLists.txt | 8 ++------ ext/native/tools/atlastool.cpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ext/native/tools/CMakeLists.txt b/ext/native/tools/CMakeLists.txt index f828fbe2a0..54d2d21650 100644 --- a/ext/native/tools/CMakeLists.txt +++ b/ext/native/tools/CMakeLists.txt @@ -27,12 +27,9 @@ include_directories(..) include_directories(../ext) include_directories(../math/lin) include_directories(../image) -include_directories(../ext/libzip) include_directories(../ext/rg_etc1) -include_directories(../ext/glew) include_directories(/usr/local/include) -link_directories(/usr/X11R6/lib) link_directories(/opt/local/lib) # Horrible horrible hack @@ -47,14 +44,13 @@ add_subdirectory(../file file) add_subdirectory(../image image) add_subdirectory(../math math) add_subdirectory(../util util) -add_subdirectory(../ext/libzip libzip) add_subdirectory(../ext/rg_etc1 rg_etc1) add_subdirectory(../ext/stb_image stb_image) add_subdirectory(../ext/libpng17 png17) add_executable(atlastool atlastool.cpp) -target_link_libraries(atlastool png17 freetype util image z stb_image rg_etc1 file zip base) +target_link_libraries(atlastool freetype util image png17 z stb_image rg_etc1 file base) add_executable(zimtool zimtool.cpp) -target_link_libraries(zimtool png17 freetype image z stb_image rg_etc1 file zip base) +target_link_libraries(zimtool freetype image png17 z stb_image rg_etc1 file base) diff --git a/ext/native/tools/atlastool.cpp b/ext/native/tools/atlastool.cpp index c23424174d..e5341fd3be 100644 --- a/ext/native/tools/atlastool.cpp +++ b/ext/native/tools/atlastool.cpp @@ -18,7 +18,7 @@ // Hackery for our broken path structure #include #else -#include +#include #endif #include #include From 18f452ff297e208414ea5e5ab743e5c65eb26027 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Wed, 16 Sep 2015 01:59:22 -0300 Subject: [PATCH 7/7] Ops fix this. --- Qt/PPSSPP.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index b7db5403f4..8c8409ff87 100644 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -90,7 +90,7 @@ arm:android: SOURCES += $$P/android/jni/ArmEmitterTest.cpp HEADERS += $$P/UI/*.h INCLUDEPATH += $$P $$P/Common $$P/ext/native $$P/ext/native/ext -exists( /usr/include/GL/glew.h ) { +!exists( /usr/include/GL/glew.h ) { INCLUDEPATH += $$P/ext/native/ext/glew }