[aseprite] 28/250: Disable webp support by default (related to #799)

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 2a0f8ca536065af581f69b348c9d10baf0abd4bd
Author: David Capello <davidcapello at gmail.com>
Date:   Mon Sep 7 14:43:31 2015 -0300

    Disable webp support by default (related to #799)
    
    There is a new WITH_WEBP_SUPPORT cmake option to enable webp support.
---
 CMakeLists.txt                        | 22 +++++++++++++---------
 src/app/CMakeLists.txt                | 29 +++++++++++++++++++----------
 src/app/file/file_formats_manager.cpp |  6 ++++++
 third_party/CMakeLists.txt            |  6 ++++--
 4 files changed, 42 insertions(+), 21 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a381608..629f3dd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,6 +33,8 @@ project(aseprite C CXX)
 # Options (these can be specified in cmake command line or modifying
 # CMakeCache.txt)
 
+option(WITH_WEBP_SUPPORT  "Enable support to load/save .webp files" off)
+
 option(USE_STATIC_LIBC    "Use static version of C and C++ runtimes" off)
 option(USE_SHARED_CURL    "Use your installed copy of curl" off)
 option(USE_SHARED_GIFLIB  "Use your installed copy of giflib" off)
@@ -173,17 +175,19 @@ include_directories(${PNG_INCLUDE_DIR})
 add_definitions(-DPNG_NO_MMX_CODE) # Do not use MMX optimizations in PNG code
 
 # libwebp
-if(USE_SHARED_LIBWEBP)
-  find_package(PkgConfig)
-  pkg_check_modules(WEBP libwebp)
-  if(NOT WEBP_FOUND)
-    message(FATAL_ERROR "libwebp not found")
+if(WITH_WEBP_SUPPORT)
+  if(USE_SHARED_LIBWEBP)
+    find_package(PkgConfig)
+    pkg_check_modules(WEBP libwebp)
+    if(NOT WEBP_FOUND)
+      message(FATAL_ERROR "libwebp not found")
+    endif()
+  else()
+    set(WEBP_LIBRARIES webp)
+    set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src)
   endif()
-else()
-  set(WEBP_LIBRARIES webp)
-  set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src)
+  include_directories(${WEBP_INCLUDE_DIR})
 endif()
-include_directories(${WEBP_INCLUDE_DIR})
 
 # tinyxml
 if(USE_SHARED_TINYXML)
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index 0125cdd..3d1ab30 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -56,6 +56,10 @@ list(APPEND generated_files ${output_fn})
 # Directory where generated files by "gen" utility will stay.
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
+if(WITH_WEBP_SUPPORT)
+  add_definitions(-DASEPRITE_WITH_WEBP_SUPPORT)
+endif()
+
 ######################################################################
 # app-lib target
 
@@ -70,6 +74,20 @@ if(NOT ENABLE_TRIAL_MODE)
     ui/data_recovery_view.cpp)
 endif()
 
+set(file_formats
+  file/ase_format.cpp
+  file/bmp_format.cpp
+  file/fli_format.cpp
+  file/gif_format.cpp
+  file/ico_format.cpp
+  file/jpeg_format.cpp
+  file/pcx_format.cpp
+  file/png_format.cpp
+  file/tga_format.cpp)
+if(WITH_WEBP_SUPPORT)
+  list(APPEND file_formats file/webp_format.cpp)
+endif()
+
 add_library(app-lib
   app.cpp
   app_menus.cpp
@@ -259,22 +277,13 @@ add_library(app-lib
   document_range_ops.cpp
   document_undo.cpp
   extra_cel.cpp
-  file/ase_format.cpp
-  file/bmp_format.cpp
   file/file.cpp
   file/file_format.cpp
   file/file_formats_manager.cpp
   file/fli/fli.cpp
-  file/fli_format.cpp
-  file/gif_format.cpp
-  file/ico_format.cpp
-  file/jpeg_format.cpp
   file/palette_file.cpp
-  file/pcx_format.cpp
-  file/png_format.cpp
   file/split_filename.cpp
-  file/tga_format.cpp
-  file/webp_format.cpp
+  ${file_formats}
   file_selector.cpp
   file_system.cpp
   filename_formatter.cpp
diff --git a/src/app/file/file_formats_manager.cpp b/src/app/file/file_formats_manager.cpp
index 74b78e8..ec0b207 100644
--- a/src/app/file/file_formats_manager.cpp
+++ b/src/app/file/file_formats_manager.cpp
@@ -29,7 +29,10 @@ extern FileFormat* CreateJpegFormat();
 extern FileFormat* CreatePcxFormat();
 extern FileFormat* CreatePngFormat();
 extern FileFormat* CreateTgaFormat();
+
+#ifdef ASEPRITE_WITH_WEBP_SUPPORT
 extern FileFormat* CreateWebPFormat();
+#endif
 
 static FileFormatsManager* singleton = NULL;
 
@@ -68,7 +71,10 @@ void FileFormatsManager::registerAllFormats()
   registerFormat(CreatePcxFormat());
   registerFormat(CreatePngFormat());
   registerFormat(CreateTgaFormat());
+
+#ifdef ASEPRITE_WITH_WEBP_SUPPORT
   registerFormat(CreateWebPFormat());
+#endif
 }
 
 void FileFormatsManager::registerFormat(FileFormat* fileFormat)
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 9bcedd1..07c2777 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -20,8 +20,10 @@ if(NOT USE_SHARED_LIBPNG)
   add_subdirectory(libpng)
 endif()
 
-if(NOT USE_SHARED_LIBWEBP)
-  add_subdirectory(libwebp-cmake)
+if(WITH_WEBP_SUPPORT)
+  if(NOT USE_SHARED_LIBWEBP)
+    add_subdirectory(libwebp-cmake)
+  endif()
 endif()
 
 if(NOT USE_SHARED_GIFLIB)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list