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

Side by Side Diff: cmake/CMakeLists.txt

Issue 1353383003: CMake: Compile in OSMesa on Linux, if found. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-21 (Monday) 11:41:37 EDT 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 | no next file » | 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 # Make our ports choices. 93 # Make our ports choices.
94 remove_srcs( 94 remove_srcs(
95 ../src/*moz* # We're probably not Mozilla. 95 ../src/*moz* # We're probably not Mozilla.
96 ../src/gpu/GrContextFactory.cpp # For internal testing only . 96 ../src/gpu/GrContextFactory.cpp # For internal testing only .
97 ../src/gpu/gl/GrGLCreateNativeInterface_none.cpp 97 ../src/gpu/gl/GrGLCreateNativeInterface_none.cpp
98 ../src/gpu/gl/GrGLDefaultInterface_none.cpp 98 ../src/gpu/gl/GrGLDefaultInterface_none.cpp
99 ../src/gpu/gl/SkCreatePlatformGLContext*.cpp # For internal testing only . 99 ../src/gpu/gl/SkCreatePlatformGLContext*.cpp # For internal testing only .
100 ../src/gpu/gl/command_buffer/* 100 ../src/gpu/gl/command_buffer/*
101 ../src/gpu/gl/egl/* 101 ../src/gpu/gl/egl/*
102 ../src/gpu/gl/iOS/* 102 ../src/gpu/gl/iOS/*
103 ../src/gpu/gl/mesa/*
104 ../src/opts/SkBitmapProcState_opts_none.cpp 103 ../src/opts/SkBitmapProcState_opts_none.cpp
105 ../src/opts/SkBlitMask_opts_none.cpp 104 ../src/opts/SkBlitMask_opts_none.cpp
106 ../src/opts/SkBlitRow_opts_none.cpp 105 ../src/opts/SkBlitRow_opts_none.cpp
107 ../src/ports/SkFontMgr_empty_factory.cpp 106 ../src/ports/SkFontMgr_empty_factory.cpp
108 ../src/ports/SkGlobalInitialization_chromium.cpp 107 ../src/ports/SkGlobalInitialization_chromium.cpp
109 ../src/ports/SkImageDecoder_empty.cpp 108 ../src/ports/SkImageDecoder_empty.cpp
110 ../src/ports/SkImageGenerator_none.cpp 109 ../src/ports/SkImageGenerator_none.cpp
111 ../src/ports/SkTLS_none.cpp) 110 ../src/ports/SkTLS_none.cpp)
112 111
113 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco mpatible giflib. 112 remove_srcs(../src/codec/*) # TODO: Requires Chromium's libjpeg-turbo, and inco mpatible giflib.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 endif() 191 endif()
193 192
194 if (APPLE) 193 if (APPLE)
195 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) 194 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED)
196 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) 195 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK})
197 endif() 196 endif()
198 197
199 find_package(OpenGL REQUIRED) 198 find_package(OpenGL REQUIRED)
200 list (APPEND libs ${OPENGL_LIBRARIES}) 199 list (APPEND libs ${OPENGL_LIBRARIES})
201 200
201 if (UNIX AND NOT APPLE AND EXISTS "/usr/include/GL/osmesa.h")
mtklein 2015/09/21 15:49:37 Can you not do this like one of the other dependen
202 list (APPEND libs "OSMesa")
203 target_compile_definitions(skia
204 PUBLIC -DSK_MESA
205 PRIVATE -DSK_MESA)
206 else()
207 remove_srcs(../src/gpu/gl/mesa/*)
208 endif()
209
202 # This is our main output, libskia.so. 210 # This is our main output, libskia.so.
203 # We mostly build an .so here because it helps test we've linked everything, 211 # 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 . 212 # not so much that we think Skia is a good candidate to ship as a shared library .
205 add_library (skia SHARED ${srcs}) 213 add_library (skia SHARED ${srcs})
206 214
207 target_compile_definitions(skia 215 target_compile_definitions(skia
208 PUBLIC 216 PUBLIC
209 PRIVATE -DSKIA_DLL) 217 PRIVATE -DSKIA_DLL)
210 218
211 target_include_directories(skia 219 target_include_directories(skia
(...skipping 11 matching lines...) Expand all
223 VISIBILITY_INLINES_HIDDEN true) 231 VISIBILITY_INLINES_HIDDEN true)
224 232
225 # Experimental C API install: 233 # Experimental C API install:
226 file(GLOB cheaders "../include/c/*.h") 234 file(GLOB cheaders "../include/c/*.h")
227 install(FILES ${cheaders} DESTINATION include) 235 install(FILES ${cheaders} DESTINATION include)
228 install(TARGETS skia DESTINATION lib) 236 install(TARGETS skia DESTINATION lib)
229 237
230 # Now build a simple example app that uses Skia via libskia.so. 238 # Now build a simple example app that uses Skia via libskia.so.
231 add_executable(example example.cpp) 239 add_executable(example example.cpp)
232 target_link_libraries(example skia ${OPENGL_LIBRARIES}) 240 target_link_libraries(example skia ${OPENGL_LIBRARIES})
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698