summaryrefslogtreecommitdiff
path: root/platform/linux
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-11-03 01:59:24 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-11-04 18:43:08 +0200
commite66cc2e583b8a56f1c9ace613c9bf6c1d0643712 (patch)
tree9e49031a64da303675cc545bc852163d4eb5abeb /platform/linux
parentf376827ed21115c43347841e346f908697179fd0 (diff)
downloadqtlocation-mapboxgl-e66cc2e583b8a56f1c9ace613c9bf6c1d0643712.tar.gz
[linux] Added OSMesa headless backend
Diffstat (limited to 'platform/linux')
-rw-r--r--platform/linux/config.cmake31
1 files changed, 28 insertions, 3 deletions
diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake
index 6bde3136f2..e8de737835 100644
--- a/platform/linux/config.cmake
+++ b/platform/linux/config.cmake
@@ -1,4 +1,5 @@
mason_use(glfw VERSION 3.2.1)
+mason_use(mesa VERSION 13.0.0)
mason_use(boost_libprogram_options VERSION 1.60.0)
mason_use(sqlite VERSION 3.14.2)
mason_use(libuv VERSION 1.9.1)
@@ -11,7 +12,34 @@ mason_use(benchmark VERSION 1.0.0)
include(cmake/loop-uv.cmake)
+macro(use_glx_backend _TARGET)
+ target_sources(${_TARGET}
+ PRIVATE platform/default/headless_backend_glx.cpp
+ )
+
+ target_link_libraries(${_TARGET}
+ PUBLIC -lGL
+ PUBLIC -lX11
+ )
+endmacro()
+
+macro(use_osmesa_backend _TARGET)
+ target_sources(${_TARGET}
+ PRIVATE platform/default/headless_backend_osmesa.cpp
+ )
+
+ target_add_mason_package(${_TARGET}
+ PUBLIC mesa
+ )
+endmacro()
+
macro(mbgl_platform_core)
+ if (WITH_OSMESA)
+ use_osmesa_backend(mbgl-core)
+ else()
+ use_glx_backend(mbgl-core)
+ endif()
+
target_sources(mbgl-core
# File source
PRIVATE platform/default/asset_file_source.cpp
@@ -41,7 +69,6 @@ macro(mbgl_platform_core)
PRIVATE platform/default/webp_reader.cpp
# Headless view
- PRIVATE platform/default/headless_backend_glx.cpp
PRIVATE platform/default/headless_backend.cpp
PRIVATE platform/default/headless_display.cpp
PRIVATE platform/default/offscreen_view.cpp
@@ -63,8 +90,6 @@ macro(mbgl_platform_core)
target_link_libraries(mbgl-core
PUBLIC -lz
PUBLIC -lcurl
- PUBLIC -lGL
- PUBLIC -lX11
)
endmacro()