[build] make headless rendering work with Qt on macOS
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user