summaryrefslogtreecommitdiff
path: root/platform/linux/config.cmake
diff options
context:
space:
mode:
authorTiago Vignatti <tvignatti@gmail.com>2016-08-01 17:30:43 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-11-17 01:01:15 +0100
commit32b6f2fa0383f04855a181f6db61df84968ec97c (patch)
treeb47e1f03cb06924d16ac1a514dc4727ea0053b75 /platform/linux/config.cmake
parent50f0f919c38a905b8b169fcbd3e77c03bf48d17b (diff)
downloadqtlocation-mapboxgl-32b6f2fa0383f04855a181f6db61df84968ec97c.tar.gz
[linux] Implement EGL headless backend
Original author: Tiago Vignatti <tvignatti@gmail.com> Calling X11 window system is superfluous for headless rendering. This patch implements EGL platform using GBM, which is slightly more simple than the GLX path when using X11. In principle there are no big advantages in terms of performance etc. My motivation behind this was to get in touch with the code and the project. For testing I'm using: $ unset DISPLAY && ./build/linux-x86_64/Debug/mbgl-test v2: rebased patch against the new cmake changes; walk through render node to find a valid one; remove EGLSurface completely cause windows are not needed here.
Diffstat (limited to 'platform/linux/config.cmake')
-rw-r--r--platform/linux/config.cmake16
1 files changed, 14 insertions, 2 deletions
diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake
index b4bc030064..d2f3d3aa94 100644
--- a/platform/linux/config.cmake
+++ b/platform/linux/config.cmake
@@ -1,5 +1,5 @@
mason_use(glfw VERSION 3.2.1)
-if (WITH_OSMESA OR IS_CI_BUILD)
+if(IS_CI_BUILD)
mason_use(mesa VERSION 13.0.0${MASON_MESA_SUFFIX}${MASON_CXXABI_SUFFIX})
endif()
mason_use(boost_libprogram_options VERSION 1.60.0)
@@ -15,12 +15,24 @@ mason_use(benchmark VERSION 1.0.0)
include(cmake/loop-uv.cmake)
macro(mbgl_platform_core)
- if (WITH_OSMESA)
+ if(WITH_OSMESA)
target_sources(mbgl-core
PRIVATE platform/default/headless_backend_osmesa.cpp
PRIVATE platform/default/headless_display.cpp
)
target_add_mason_package(mbgl-core PUBLIC mesa)
+ elseif(WITH_EGL)
+ target_sources(mbgl-core
+ PRIVATE platform/linux/src/headless_backend_egl.cpp
+ PRIVATE platform/linux/src/headless_display_egl.cpp
+ )
+ # TODO: Provide surface-less EGL mesa for CI builds.
+ # https://github.com/mapbox/mapbox-gl-native/issues/7020
+ target_link_libraries(mbgl-core
+ PUBLIC -lGLESv2
+ PUBLIC -lEGL
+ PUBLIC -lgbm
+ )
else()
target_sources(mbgl-core
PRIVATE platform/linux/src/headless_backend_glx.cpp