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

Side by Side Diff: cmake/CMakeLists.txt

Issue 1705503002: Add SkCodec to the CMake build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | cmake/README.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Boilerplate. 1 # Boilerplate.
2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD. 2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD.
3 project (skimake) 3 project (skimake)
4 set (CMAKE_CXX_STANDARD 11) 4 set (CMAKE_CXX_STANDARD 11)
5 5
6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope rs. 6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope rs.
7 if (NOT CMAKE_BUILD_TYPE) 7 if (NOT CMAKE_BUILD_TYPE)
8 set (CMAKE_BUILD_TYPE Release) 8 set (CMAKE_BUILD_TYPE Release)
9 endif () 9 endif ()
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 if (WIN32) 107 if (WIN32)
108 if(SKIA_GDI) 108 if(SKIA_GDI)
109 remove_srcs(../src/ports/SkFontMgr_win_dw_factory.cpp) 109 remove_srcs(../src/ports/SkFontMgr_win_dw_factory.cpp)
110 else() 110 else()
111 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp) 111 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp)
112 endif() 112 endif()
113 endif() 113 endif()
114 114
115 remove_srcs(../src/gpu/gl/angle/*) # TODO 115 remove_srcs(../src/gpu/gl/angle/*) # TODO
116 remove_srcs(../src/codec/* ../src/android/*) # TODO: Requires Chromium's libjpe g-turbo, and incompatible giflib.
117 116
118 # Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 in trinsics. 117 # Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 in trinsics.
119 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) 118 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp)
120 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp) 119 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp)
121 file (GLOB_RECURSE avx_srcs ../src/*_avx.cpp) 120 file (GLOB_RECURSE avx_srcs ../src/*_avx.cpp)
122 file (GLOB_RECURSE avx2_srcs ../src/*_avx2.cpp) 121 file (GLOB_RECURSE avx2_srcs ../src/*_avx2.cpp)
123 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3) 122 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3)
124 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) 123 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1)
125 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx) 124 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx)
126 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2) 125 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2)
(...skipping 12 matching lines...) Expand all
139 if (UNIX AND NOT APPLE) 138 if (UNIX AND NOT APPLE)
140 find_package (Freetype) 139 find_package (Freetype)
141 # Same deal for fontconfig. 140 # Same deal for fontconfig.
142 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") 141 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h")
143 find_library (FONTCONFIG_LIBRARIES fontconfig) 142 find_library (FONTCONFIG_LIBRARIES fontconfig)
144 find_package (GIF) 143 find_package (GIF)
145 find_package (JPEG) 144 find_package (JPEG)
146 find_package (PNG) 145 find_package (PNG)
147 endif() 146 endif()
148 147
148 # Decide whether to turn on SkCodec.
149 # TODO (skbug.com/4956): We should be able to turn specific codecs on and off ra ther than
150 # disabling all of them if one library is missing.
151 if (NOT (GIF_FOUND AND JPEG_FOUND AND PNG_FOUND AND WEBP_INCLUDE_DIRS AND WEBP_L IBRARIES))
msarett 2016/02/16 19:47:12 Do the CMake bots have libwebp? Otherwise this CL
152 remove_srcs(../src/codec/* ../src/android/*)
153 endif()
154
155 # Do not compile SkRawCodec.
156 remove_srcs(../src/codec/*Raw*.cpp)
157
149 # TODO: macro away this if (found) ... else() ... endif() stuff. 158 # TODO: macro away this if (found) ... else() ... endif() stuff.
150 159
151 if (EXPAT_FOUND) 160 if (EXPAT_FOUND)
152 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) 161 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS})
153 list (APPEND libs ${EXPAT_LIBRARIES}) 162 list (APPEND libs ${EXPAT_LIBRARIES})
154 else() 163 else()
155 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) 164 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp)
156 endif() 165 endif()
157 166
158 if (GIF_FOUND) 167 if (GIF_FOUND)
(...skipping 13 matching lines...) Expand all
172 if (LUA_FOUND) 181 if (LUA_FOUND)
173 list (APPEND private_includes ${LUA_INCLUDE_DIR}) 182 list (APPEND private_includes ${LUA_INCLUDE_DIR})
174 list (APPEND libs ${LUA_LIBRARIES}) 183 list (APPEND libs ${LUA_LIBRARIES})
175 else() 184 else()
176 remove_srcs(../src/utils/*Lua*) 185 remove_srcs(../src/utils/*Lua*)
177 endif() 186 endif()
178 187
179 if (PNG_FOUND) 188 if (PNG_FOUND)
180 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) 189 list (APPEND private_includes ${PNG_INCLUDE_DIRS})
181 list (APPEND libs ${PNG_LIBRARIES}) 190 list (APPEND libs ${PNG_LIBRARIES})
191 add_definitions(-DPNG_SKIP_SETJMP_CHECK)
192 add_definitions(-DPNG_SKIP_SKIA_OPTS)
182 else() 193 else()
183 remove_srcs(../src/images/*png*) 194 remove_srcs(../src/images/*png*)
184 endif() 195 endif()
185 196
186 if (ZLIB_FOUND) 197 if (ZLIB_FOUND)
187 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) 198 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS})
188 list (APPEND libs ${ZLIB_LIBRARIES}) 199 list (APPEND libs ${ZLIB_LIBRARIES})
189 remove_srcs(../src/doc/SkDocument_PDF_None.cpp) 200 remove_srcs(../src/doc/SkDocument_PDF_None.cpp)
190 else() 201 else()
191 remove_srcs(../src/pdf/*.cpp ../src/doc/SkDocument_PDF.cpp) 202 remove_srcs(../src/pdf/*.cpp ../src/doc/SkDocument_PDF.cpp)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") 317 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n")
307 endif () 318 endif ()
308 endforeach() 319 endforeach()
309 endif() 320 endif()
310 endforeach() 321 endforeach()
311 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") 322 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n")
312 323
313 # Now build a simple example app that uses Skia via libskia.so. 324 # Now build a simple example app that uses Skia via libskia.so.
314 add_executable(example example.cpp) 325 add_executable(example example.cpp)
315 target_link_libraries(example skia ${OPENGL_LIBRARIES}) 326 target_link_libraries(example skia ${OPENGL_LIBRARIES})
OLDNEW
« no previous file with comments | « no previous file | cmake/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698