Skip to content

Commit

Permalink
Fix compilation for Android with Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamNik committed Sep 5, 2024
1 parent 5103b27 commit 60e1d1c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ elseif(ANDROID)
CACHE INTERNAL ""
)
endif()
add_compile_definitions(ANDROID)
endif()

# When building a bundle on MacOS, we want to keep build paths in the library
Expand Down Expand Up @@ -667,6 +668,7 @@ if (BUILD_GUI)
if (ENABLE_QT6)
find_package(Qt6
REQUIRED COMPONENTS
Location
OpenGL
OpenGLWidgets
Quick
Expand Down
9 changes: 5 additions & 4 deletions plugins/feature/map/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ if(NOT SERVER_MODE)
)

set(TARGET_NAME ${PLUGINS_PREFIX}map)
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Svg Qt::Positioning Qt::Location)
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})

if(Qt${QT_DEFAULT_MAJOR_VERSION}WebEngine_FOUND)
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Svg Qt::Positioning Qt::Location Qt::WebEngine Qt::WebEngineCore Qt::WebEngineWidgets)
set(TARGET_LIB ${TARGET_LIB} Qt::WebEngine Qt::WebEngineCore Qt::WebEngineWidgets)
elseif(Qt${QT_DEFAULT_MAJOR_VERSION}WebEngineCore_FOUND)
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Svg Qt::SvgWidgets Qt::Positioning Qt::Location Qt::WebEngineCore Qt::WebEngineWidgets)
else()
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Svg Qt::Positioning Qt::Location)
set(TARGET_LIB ${TARGET_LIB} Qt::SvgWidgets Qt::WebEngineCore Qt::WebEngineWidgets)
elseif(ANDROID)
set(TARGET_LIB ${TARGET_LIB} Qt::SvgWidgets)
endif()
else()
set(TARGET_NAME ${PLUGINSSRV_PREFIX}mapsrv)
Expand Down
8 changes: 7 additions & 1 deletion sdrgui/gui/glshaderspectrogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@

#include <QOpenGLShaderProgram>
#include <QOpenGLFunctions>
#include <QOpenGLFunctions_3_3_Core>
#if defined(ANDROID)
#include <QOpenGLFunctions_ES2>
#else
#include <QOpenGLFunctions_2_0>
#include <QOpenGLFunctions_2_1>
#include <QOpenGLFunctions_3_0>
#endif
#include <QOpenGLContext>
#include <QtOpenGL>
#include <QImage>
Expand Down
4 changes: 4 additions & 0 deletions sdrgui/gui/glshadertvarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@

#include <QString>
#include <QOpenGLFunctions>
#if defined(ANDROID)
#include <QOpenGLFunctions_ES2>
#else
#include <QOpenGLFunctions_2_0>
#include <QOpenGLFunctions_2_1>
#include <QOpenGLFunctions_3_0>
#endif
#include <QOpenGLTexture>
#include <QOpenGLShaderProgram>
#include <QOpenGLVertexArrayObject>
Expand Down

0 comments on commit 60e1d1c

Please sign in to comment.