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

Side by Side Diff: cmake/CMakeLists.txt

Issue 1349163003: experiment/fiddle (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/SkUserConfig.h.in » ('j') | experimental/fiddle/Makefile » ('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
11 # To first approximation, the Skia library comprises all .cpp files under src/. 11 # To first approximation, the Skia library comprises all .cpp files under src/.
12 file (GLOB_RECURSE srcs ../src/*.cpp) 12 file (GLOB_RECURSE srcs ../src/*.cpp)
13 13
14 function (find_include_dirs out) 14 function (find_include_dirs out)
15 file (GLOB_RECURSE headers ${ARGN}) 15 file (GLOB_RECURSE headers ${ARGN})
16 foreach (path ${headers}) 16 foreach (path ${headers})
17 get_filename_component (dir ${path} PATH) 17 get_filename_component (dir ${path} PATH)
18 list (APPEND include_dirs ${dir}) 18 list (APPEND include_dirs ${dir})
19 endforeach() 19 endforeach()
20 list (REMOVE_DUPLICATES include_dirs) 20 list (REMOVE_DUPLICATES include_dirs)
21 set (${out} ${include_dirs} PARENT_SCOPE) 21 set (${out} ${include_dirs} PARENT_SCOPE)
22 endfunction() 22 endfunction()
23 23
24 # We need src/ directories and include/private on our path when building Skia. 24 # We need src/ directories and include/private on our path when building Skia.
25 # Users should be able to use Skia with only include/ directories that are not i nclude/private. 25 # Users should be able to use Skia with only include/ directories that are not i nclude/private.
26 find_include_dirs(private_includes ../src/*.h ../include/private/*.h) 26 find_include_dirs(private_includes ../src/*.h ../include/private/*.h)
mtklein 2015/09/17 13:58:22 add include/config/*.h here instead?
27 find_include_dirs(public_includes ../include/*.h) 27 find_include_dirs(public_includes ../include/*.h)
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 29
30 find_include_dirs(config_include ../include/config/*.h)
31 list (REMOVE_ITEM public_includes ${config_include})
32
30 # These guys are third_party but provided by a Skia checkout. 33 # These guys are third_party but provided by a Skia checkout.
31 list (APPEND srcs ../third_party/etc1/etc1.cpp ../third_party/ktx/kt x.cpp) 34 list (APPEND srcs ../third_party/etc1/etc1.cpp ../third_party/ktx/kt x.cpp)
32 list (APPEND private_includes ../third_party/etc1 ../third_party/ktx) 35 list (APPEND private_includes ../third_party/etc1 ../third_party/ktx)
33 36
34 function (remove_srcs) 37 function (remove_srcs)
35 file (GLOB_RECURSE to_remove ${ARGN}) 38 file (GLOB_RECURSE to_remove ${ARGN})
36 list (REMOVE_ITEM srcs ${to_remove}) 39 list (REMOVE_ITEM srcs ${to_remove})
37 set (srcs ${srcs} PARENT_SCOPE) 40 set (srcs ${srcs} PARENT_SCOPE)
38 endfunction() 41 endfunction()
39 42
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 # Make our ports choices. 96 # Make our ports choices.
94 remove_srcs( 97 remove_srcs(
95 ../src/*moz* # We're probably not Mozilla. 98 ../src/*moz* # We're probably not Mozilla.
96 ../src/gpu/GrContextFactory.cpp # For internal testing only . 99 ../src/gpu/GrContextFactory.cpp # For internal testing only .
97 ../src/gpu/gl/GrGLCreateNativeInterface_none.cpp 100 ../src/gpu/gl/GrGLCreateNativeInterface_none.cpp
98 ../src/gpu/gl/GrGLDefaultInterface_none.cpp 101 ../src/gpu/gl/GrGLDefaultInterface_none.cpp
99 ../src/gpu/gl/SkCreatePlatformGLContext*.cpp # For internal testing only . 102 ../src/gpu/gl/SkCreatePlatformGLContext*.cpp # For internal testing only .
100 ../src/gpu/gl/command_buffer/* 103 ../src/gpu/gl/command_buffer/*
101 ../src/gpu/gl/egl/* 104 ../src/gpu/gl/egl/*
102 ../src/gpu/gl/iOS/* 105 ../src/gpu/gl/iOS/*
103 ../src/gpu/gl/mesa/*
104 ../src/opts/SkBitmapProcState_opts_none.cpp 106 ../src/opts/SkBitmapProcState_opts_none.cpp
105 ../src/opts/SkBlitMask_opts_none.cpp 107 ../src/opts/SkBlitMask_opts_none.cpp
106 ../src/opts/SkBlitRow_opts_none.cpp 108 ../src/opts/SkBlitRow_opts_none.cpp
107 ../src/ports/SkFontMgr_empty_factory.cpp 109 ../src/ports/SkFontMgr_empty_factory.cpp
108 ../src/ports/SkGlobalInitialization_chromium.cpp 110 ../src/ports/SkGlobalInitialization_chromium.cpp
109 ../src/ports/SkImageDecoder_empty.cpp 111 ../src/ports/SkImageDecoder_empty.cpp
110 ../src/ports/SkImageGenerator_none.cpp 112 ../src/ports/SkImageGenerator_none.cpp
111 ../src/ports/SkTLS_none.cpp) 113 ../src/ports/SkTLS_none.cpp)
112 114
113 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco mpatible giflib. 115 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco mpatible giflib.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if (FREETYPE_FOUND) 186 if (FREETYPE_FOUND)
185 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS}) 187 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS})
186 list (APPEND libs ${FREETYPE_LIBRARIES}) 188 list (APPEND libs ${FREETYPE_LIBRARIES})
187 endif() 189 endif()
188 190
189 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES) 191 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES)
190 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS}) 192 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS})
191 list (APPEND libs ${FONTCONFIG_LIBRARIES}) 193 list (APPEND libs ${FONTCONFIG_LIBRARIES})
192 endif() 194 endif()
193 195
196
194 if (APPLE) 197 if (APPLE)
195 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) 198 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED)
196 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) 199 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK})
197 endif() 200 endif()
198 201
199 find_package(OpenGL REQUIRED) 202 find_package(OpenGL REQUIRED)
200 list (APPEND libs ${OPENGL_LIBRARIES}) 203 list (APPEND libs ${OPENGL_LIBRARIES})
201 204
205 set(SK_MESA OFF CACHE BOOL "Support for off-screen Mesa OpenGL")
206 if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
mtklein 2015/09/17 13:58:22 This seems unnecessary. SK_DEBUG / SK_RELEASE are
207 set(SK_DEBUG 1)
208 set(SK_RELEASE 0)
209 else()
210 set(SK_DEBUG 0)
211 set(SK_RELEASE 1)
212 endif()
213 configure_file(SkUserConfig.h.in SkUserConfig.h)
mtklein 2015/09/17 13:58:22 Let's not do this. I haven't seen any need yet fo
214
202 # This is our main output, libskia.so. 215 # This is our main output, libskia.so.
203 # We mostly build an .so here because it helps test we've linked everything, 216 # We mostly build an .so here because it helps test we've linked everything,
204 # not so much that we think Skia is a good candidate to ship as a shared library . 217 # not so much that we think Skia is a good candidate to ship as a shared library .
205 add_library (skia SHARED ${srcs}) 218 add_library (skia SHARED ${srcs})
206 219
220 if (UNIX AND NOT APPLE AND SK_MESA)
mtklein 2015/09/17 13:58:22 Why is this opt-in? Can we not just detect it lik
221 # TODO(halcanary): support SK_MESA+APPLE
222 list (APPEND libs "OSMesa")
223 # SK_MESA is used by fiddle.skia.org
224 else()
225 remove_srcs(../src/gpu/gl/mesa/*)
226 endif()
227
207 target_compile_definitions(skia 228 target_compile_definitions(skia
208 PUBLIC 229 PUBLIC
209 PRIVATE -DSKIA_DLL) 230 PRIVATE -DSKIA_DLL)
210 231
211 target_include_directories(skia 232 target_include_directories(skia
212 PUBLIC ${public_includes} 233 PUBLIC ${public_includes}
234 ${CMAKE_BINARY_DIR}
213 PRIVATE ${private_includes}) 235 PRIVATE ${private_includes})
214 236
215 target_link_libraries(skia 237 target_link_libraries(skia
216 PUBLIC 238 PUBLIC
217 PRIVATE ${libs}) 239 PRIVATE ${libs})
218 240
219
220 set_target_properties(skia PROPERTIES 241 set_target_properties(skia PROPERTIES
221 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations" 242 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations"
222 CXX_VISIBILITY_PRESET hidden 243 CXX_VISIBILITY_PRESET hidden
223 VISIBILITY_INLINES_HIDDEN true) 244 VISIBILITY_INLINES_HIDDEN true)
224 245
225 # Experimental C API install: 246 # Experimental install:
226 file(GLOB cheaders "../include/c/*.h")
227 install(FILES ${cheaders} DESTINATION include)
228 install(TARGETS skia DESTINATION lib) 247 install(TARGETS skia DESTINATION lib)
248 install(DIRECTORY ../include/c DESTINATION include/skia)
249 install(DIRECTORY ../include/core DESTINATION include/skia)
mtklein 2015/09/17 13:58:22 Yeah, again, I think it's a bad idea to even insin
250 install(DIRECTORY ../include/effects DESTINATION include/skia)
251 install(DIRECTORY ../include/gpu DESTINATION include/skia)
252 install(DIRECTORY ../include/pathops DESTINATION include/skia)
253 install(DIRECTORY ../include/ports DESTINATION include/skia)
254 install(DIRECTORY ../include/private DESTINATION include/skia)
255 install(DIRECTORY ../include/utils DESTINATION include/skia)
256 install(FILES ${CMAKE_BINARY_DIR}/SkUserConfig.h DESTINATION include/skia/core)
229 257
230 # Now build a simple example app that uses Skia via libskia.so. 258 # Now build a simple example app that uses Skia via libskia.so.
231 add_executable(example example.cpp) 259 add_executable(example example.cpp)
232 target_link_libraries(example skia ${OPENGL_LIBRARIES}) 260 target_link_libraries(example skia ${OPENGL_LIBRARIES})
OLDNEW
« no previous file with comments | « no previous file | cmake/SkUserConfig.h.in » ('j') | experimental/fiddle/Makefile » ('J')

Powered by Google App Engine
This is Rietveld 408576698