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

Side by Side Diff: cmake/CMakeLists.txt

Issue 2033063003: Check libpng directly into third_party/ (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: public.bzl Created 4 years, 6 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 | public.bzl » ('j') | public.bzl » ('J')
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 17 matching lines...) Expand all
28 list (REMOVE_ITEM public_includes ${private_includes}) # Easiest way to exclude private. 28 list (REMOVE_ITEM public_includes ${private_includes}) # Easiest way to exclude private.
29 file (GLOB default_include_config "../include/config") 29 file (GLOB default_include_config "../include/config")
30 list (REMOVE_ITEM public_includes ${default_include_config}) 30 list (REMOVE_ITEM public_includes ${default_include_config})
31 set (userconfig_directory ${CMAKE_BINARY_DIR}/include) 31 set (userconfig_directory ${CMAKE_BINARY_DIR}/include)
32 list (APPEND public_includes ${userconfig_directory}) 32 list (APPEND public_includes ${userconfig_directory})
33 33
34 # These guys are third_party but provided by a Skia checkout. 34 # These guys are third_party but provided by a Skia checkout.
35 list (APPEND srcs ../third_party/etc1/etc1.cpp ../third_party/ktx/kt x.cpp) 35 list (APPEND srcs ../third_party/etc1/etc1.cpp ../third_party/ktx/kt x.cpp)
36 list (APPEND private_includes ../third_party/etc1 ../third_party/ktx) 36 list (APPEND private_includes ../third_party/etc1 ../third_party/ktx)
37 37
38 list (APPEND private_includes ../third_party/libpng)
39 file (GLOB libpng_srcs ../third_party/libpng/*.c)
40 foreach (src ${libpng_srcs})
41 list (APPEND srcs ${src})
42 endforeach()
43
44
38 function (remove_srcs) 45 function (remove_srcs)
39 file (GLOB_RECURSE to_remove ${ARGN}) 46 file (GLOB_RECURSE to_remove ${ARGN})
40 list (REMOVE_ITEM srcs ${to_remove}) 47 list (REMOVE_ITEM srcs ${to_remove})
41 set (srcs ${srcs} PARENT_SCOPE) 48 set (srcs ${srcs} PARENT_SCOPE)
42 endfunction() 49 endfunction()
43 50
44 # This file is empty and is only used to trick GYP. 51 # This file is empty and is only used to trick GYP.
45 remove_srcs (../src/core/SkForceCPlusPlusLinking.cpp) 52 remove_srcs (../src/core/SkForceCPlusPlusLinking.cpp)
46 # Chrome only? 53 # Chrome only?
47 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp 54 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") 148 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h")
142 find_library(OSMESA_LIBRARIES "OSMesa") 149 find_library(OSMESA_LIBRARIES "OSMesa")
143 150
144 if (UNIX AND NOT APPLE) 151 if (UNIX AND NOT APPLE)
145 find_package (Freetype) 152 find_package (Freetype)
146 # Same deal for fontconfig. 153 # Same deal for fontconfig.
147 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") 154 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h")
148 find_library (FONTCONFIG_LIBRARIES fontconfig) 155 find_library (FONTCONFIG_LIBRARIES fontconfig)
149 find_package (GIF) 156 find_package (GIF)
150 find_package (JPEG) 157 find_package (JPEG)
151 find_package (PNG)
152 endif() 158 endif()
153 159
154 # Do not compile SkRawCodec. 160 # Do not compile SkRawCodec.
155 remove_srcs(../src/codec/*Raw*.cpp) 161 remove_srcs(../src/codec/*Raw*.cpp)
156 162
157 # TODO: macro away this if (found) ... else() ... endif() stuff. 163 # TODO: macro away this if (found) ... else() ... endif() stuff.
158 164
159 if (EXPAT_FOUND) 165 if (EXPAT_FOUND)
160 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) 166 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS})
161 list (APPEND libs ${EXPAT_LIBRARIES}) 167 list (APPEND libs ${EXPAT_LIBRARIES})
(...skipping 19 matching lines...) Expand all
181 remove_srcs(../src/codec/*Jpeg*) 187 remove_srcs(../src/codec/*Jpeg*)
182 endif() 188 endif()
183 189
184 if (LUA_FOUND) 190 if (LUA_FOUND)
185 list (APPEND private_includes ${LUA_INCLUDE_DIR}) 191 list (APPEND private_includes ${LUA_INCLUDE_DIR})
186 list (APPEND libs ${LUA_LIBRARIES}) 192 list (APPEND libs ${LUA_LIBRARIES})
187 else() 193 else()
188 remove_srcs(../src/utils/*Lua*) 194 remove_srcs(../src/utils/*Lua*)
189 endif() 195 endif()
190 196
191 if (PNG_FOUND) 197 # PNG
192 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) 198 add_definitions(-DSK_HAS_PNG_LIBRARY)
193 list (APPEND libs ${PNG_LIBRARIES}) 199 add_definitions(-DPNG_ARM_NEON_OPT=0)
194 add_definitions(-DPNG_SKIP_SETJMP_CHECK)
195 add_definitions(-DPNG_SKIP_SKIA_OPTS)
196 add_definitions(-DSK_HAS_PNG_LIBRARY)
197 else()
198 remove_srcs(../src/images/*PNG*)
199 remove_srcs(../src/codec/*Png*)
200 remove_srcs(../src/codec/*Ico*)
201 endif()
202 200
203 if (ZLIB_FOUND) 201 if (ZLIB_FOUND)
204 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) 202 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS})
205 list (APPEND libs ${ZLIB_LIBRARIES}) 203 list (APPEND libs ${ZLIB_LIBRARIES})
206 remove_srcs(../src/pdf/SkDocument_PDF_None.cpp) 204 remove_srcs(../src/pdf/SkDocument_PDF_None.cpp)
207 else() 205 else()
208 remove_srcs(../src/pdf/*.cpp) 206 remove_srcs(../src/pdf/*.cpp)
209 set (srcs ${srcs} ../src/pdf/SkDocument_PDF_None.cpp) 207 set (srcs ${srcs} ../src/pdf/SkDocument_PDF_None.cpp)
210 endif() 208 endif()
211 209
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") 346 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n")
349 endif () 347 endif ()
350 endforeach() 348 endforeach()
351 endif() 349 endif()
352 endforeach() 350 endforeach()
353 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") 351 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n")
354 352
355 # Now build a simple example app that uses Skia via libskia.so. 353 # Now build a simple example app that uses Skia via libskia.so.
356 add_executable(example example.cpp) 354 add_executable(example example.cpp)
357 target_link_libraries(example skia ${OPENGL_LIBRARIES}) 355 target_link_libraries(example skia ${OPENGL_LIBRARIES})
OLDNEW
« no previous file with comments | « no previous file | public.bzl » ('j') | public.bzl » ('J')

Powered by Google App Engine
This is Rietveld 408576698