summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-07-26 12:29:01 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-08-05 11:42:22 +0200
commita2e758b4177547fa60155ad8fd5ab5b8f17d6511 (patch)
tree9dfc6cf6ce9cf732cd4ce3879619f949ac406674 /platform
parent5f70a65a2cc33883637fcc9d13ef2c81eba9b75c (diff)
downloadqtlocation-mapboxgl-a2e758b4177547fa60155ad8fd5ab5b8f17d6511.tar.gz
[build] make headless rendering work with Qt on macOS
Diffstat (limited to 'platform')
-rw-r--r--platform/qt/config.cmake9
-rw-r--r--platform/qt/qt.cmake9
2 files changed, 8 insertions, 10 deletions
diff --git a/platform/qt/config.cmake b/platform/qt/config.cmake
index 5a5a150286..5e3b0bd92a 100644
--- a/platform/qt/config.cmake
+++ b/platform/qt/config.cmake
@@ -40,12 +40,9 @@ macro(mbgl_platform_core)
endmacro()
# TODO: Implement a Qt headless view, using offscreen
-# graphics system. Right now tests are Linux only.
+# graphics system.
macro(mbgl_platform_test)
target_sources(mbgl-test
- PRIVATE platform/default/headless_display.cpp
- PRIVATE platform/default/headless_view.cpp
- PRIVATE platform/default/headless_view_glx.cpp
PRIVATE test/src/main.cpp
)
@@ -53,8 +50,4 @@ macro(mbgl_platform_test)
test/src/main.cpp
PROPERTIES COMPILE_FLAGS -DWORK_DIRECTORY="${CMAKE_SOURCE_DIR}"
)
-
- target_link_libraries(mbgl-test
- PRIVATE -lX11
- )
endmacro()
diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake
index afd3ed7958..9d8ae10f9e 100644
--- a/platform/qt/qt.cmake
+++ b/platform/qt/qt.cmake
@@ -12,8 +12,6 @@ option(WITH_QT_4 "Use Qt4 instead of Qt5" OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -D__QT__")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -D__QT__")
-project(Qt4And5)
-
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -36,6 +34,10 @@ set(MBGL_QT_FILES
# Misc
PRIVATE platform/default/log_stderr.cpp
+ # Headless headless_view_cgl
+ PRIVATE platform/default/headless_display.cpp
+ PRIVATE platform/default/headless_view.cpp
+
# Platform integration
PRIVATE platform/qt/src/async_task.cpp
PRIVATE platform/qt/src/async_task_impl.hpp
@@ -83,6 +85,7 @@ endif()
if (BUILD_PLATFORM STREQUAL "macos")
list(APPEND MBGL_QT_FILES
PRIVATE platform/darwin/src/nsthread.mm
+ PRIVATE platform/darwin/src/headless_view_cgl.cpp
)
list(APPEND MBGL_QT_LIBRARIES
PRIVATE "-framework Foundation"
@@ -91,8 +94,10 @@ if (BUILD_PLATFORM STREQUAL "macos")
else()
list(APPEND MBGL_QT_FILES
PRIVATE platform/default/thread.cpp
+ PRIVATE platform/default/headless_view_glx.cpp
)
list(APPEND MBGL_QT_LIBRARIES
PRIVATE -lGL
+ PRIVATE -lX11
)
endif()