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

Unified 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:47:50 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmake/CMakeLists.txt
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 36a6d1ecf3ca947363c8197efebd4a2e5e82a64c..50e45d2226d43cbce693eb6c8205fde9bc378027 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -100,7 +100,6 @@ remove_srcs(
../src/gpu/gl/command_buffer/*
../src/gpu/gl/egl/*
../src/gpu/gl/iOS/*
- ../src/gpu/gl/mesa/*
../src/opts/SkBitmapProcState_opts_none.cpp
../src/opts/SkBlitMask_opts_none.cpp
../src/opts/SkBlitRow_opts_none.cpp
@@ -199,6 +198,13 @@ endif()
find_package(OpenGL REQUIRED)
list (APPEND libs ${OPENGL_LIBRARIES})
+if (UNIX AND NOT APPLE AND EXISTS "/usr/include/GL/osmesa.h")
+ set(SK_MESA 1)
+ list (APPEND libs "OSMesa")
+else()
+ remove_srcs(../src/gpu/gl/mesa/*)
+endif()
+
# This is our main output, libskia.so.
# We mostly build an .so here because it helps test we've linked everything,
# not so much that we think Skia is a good candidate to ship as a shared library.
@@ -208,6 +214,12 @@ target_compile_definitions(skia
PUBLIC
PRIVATE -DSKIA_DLL)
+if (SK_MESA)
+ target_compile_definitions(skia
mtklein 2015/09/21 15:51:56 Even if this works, I'd prefer it if you switch th
+ PUBLIC -DSK_MESA
+ PRIVATE -DSK_MESA)
+endif()
+
target_include_directories(skia
PUBLIC ${public_includes}
PRIVATE ${private_includes})
« 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