Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: cmake/CMakeLists.txt

Issue 1702533004: Individually enable and disable SkCodecs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add missing WEBP check, disable codecs on Google3 iOS Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gyp/codec.gyp » ('j') | src/codec/SkCodec.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmake/CMakeLists.txt
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 751361a92796e246508ee6f275735f3b71c65db1..d32c8e338647edc0d0dc6422463652413f9641f9 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -145,12 +145,9 @@ if (UNIX AND NOT APPLE)
find_package (PNG)
endif()
-# Decide whether to turn on SkCodec.
-# TODO (skbug.com/4956): We should be able to turn specific codecs on and off rather than
-# disabling all of them if one library is missing.
-if (NOT (GIF_FOUND AND JPEG_FOUND AND PNG_FOUND AND WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES))
- remove_srcs(../src/codec/* ../src/android/*)
-endif()
+# We can always turn on BMP and WBMP codecs. They don't requires any dependencies.
mtklein 2016/02/16 23:08:59 Probably no need to guard these with defines then?
msarett 2016/02/17 14:34:54 You're right. Removing these defines.
+add_definitions(-DSK_CODEC_DECODES_BMP)
+add_definitions(-DSK_CODEC_DECODES_WBMP)
# Do not compile SkRawCodec.
remove_srcs(../src/codec/*Raw*.cpp)
@@ -167,15 +164,20 @@ endif()
if (GIF_FOUND)
list (APPEND private_includes ${GIF_INCLUDE_DIRS})
list (APPEND libs ${GIF_LIBRARIES})
+ add_definitions(-DSK_CODEC_DECODES_GIF)
else()
remove_srcs(../src/images/*gif*)
+ remove_srcs(../src/codec/*Gif*)
endif()
if (JPEG_FOUND)
list (APPEND private_includes ${JPEG_INCLUDE_DIRS})
list (APPEND libs ${JPEG_LIBRARIES})
+ add_definitions(-DSK_CODEC_DECODES_JPEG)
else()
remove_srcs(../src/images/*jpeg*)
+ remove_srcs(../src/images/*Jpeg*)
+ remove_srcs(../src/codec/*Jpeg*)
endif()
if (LUA_FOUND)
@@ -190,8 +192,13 @@ if (PNG_FOUND)
list (APPEND libs ${PNG_LIBRARIES})
add_definitions(-DPNG_SKIP_SETJMP_CHECK)
add_definitions(-DPNG_SKIP_SKIA_OPTS)
+ add_definitions(-DSK_CODEC_DECODES_PNG)
+ add_definitions(-DSK_CODEC_DECODES_ICO)
else()
remove_srcs(../src/images/*png*)
+ remove_srcs(../src/images/*ico*)
+ remove_srcs(../src/codec/*Png*)
+ remove_srcs(../src/codec/*Ico*)
endif()
if (ZLIB_FOUND)
@@ -205,8 +212,10 @@ endif()
if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES)
list (APPEND private_includes ${WEBP_INCLUDE_DIRS})
list (APPEND libs ${WEBP_LIBRARIES})
+ add_definitions(-DSK_CODEC_DECODES_WEBP)
else()
remove_srcs(../src/images/*webp*)
+ remove_srcs(../src/codec/*Webp*)
endif()
if (FREETYPE_FOUND)
« no previous file with comments | « no previous file | gyp/codec.gyp » ('j') | src/codec/SkCodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698