Index: cmake/CMakeLists.txt |
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt |
index 58c04db8d935b3d336ab76065829b970bfa0563d..751361a92796e246508ee6f275735f3b71c65db1 100644 |
--- a/cmake/CMakeLists.txt |
+++ b/cmake/CMakeLists.txt |
@@ -113,7 +113,6 @@ if (WIN32) |
endif() |
remove_srcs(../src/gpu/gl/angle/*) # TODO |
-remove_srcs(../src/codec/* ../src/android/*) # TODO: Requires Chromium's libjpeg-turbo, and incompatible giflib. |
# Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 intrinsics. |
file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) |
@@ -146,6 +145,16 @@ 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)) |
msarett
2016/02/16 19:47:12
Do the CMake bots have libwebp? Otherwise this CL
|
+ remove_srcs(../src/codec/* ../src/android/*) |
+endif() |
+ |
+# Do not compile SkRawCodec. |
+remove_srcs(../src/codec/*Raw*.cpp) |
+ |
# TODO: macro away this if (found) ... else() ... endif() stuff. |
if (EXPAT_FOUND) |
@@ -179,6 +188,8 @@ endif() |
if (PNG_FOUND) |
list (APPEND private_includes ${PNG_INCLUDE_DIRS}) |
list (APPEND libs ${PNG_LIBRARIES}) |
+ add_definitions(-DPNG_SKIP_SETJMP_CHECK) |
+ add_definitions(-DPNG_SKIP_SKIA_OPTS) |
else() |
remove_srcs(../src/images/*png*) |
endif() |