1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-10 18:43:28 -05:00

Fix compilation for Android with Qt6

This commit is contained in:
DreamNik 2024-09-03 19:16:23 +03:00
parent 5103b27091
commit 60e1d1cd9e
4 changed files with 18 additions and 5 deletions

View File

@ -587,6 +587,7 @@ elseif(ANDROID)
CACHE INTERNAL "" CACHE INTERNAL ""
) )
endif() endif()
add_compile_definitions(ANDROID)
endif() endif()
# When building a bundle on MacOS, we want to keep build paths in the library # When building a bundle on MacOS, we want to keep build paths in the library
@ -667,6 +668,7 @@ if (BUILD_GUI)
if (ENABLE_QT6) if (ENABLE_QT6)
find_package(Qt6 find_package(Qt6
REQUIRED COMPONENTS REQUIRED COMPONENTS
Location
OpenGL OpenGL
OpenGLWidgets OpenGLWidgets
Quick Quick

View File

@ -83,15 +83,16 @@ if(NOT SERVER_MODE)
) )
set(TARGET_NAME ${PLUGINS_PREFIX}map) 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(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
if(Qt${QT_DEFAULT_MAJOR_VERSION}WebEngine_FOUND) 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) 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) set(TARGET_LIB ${TARGET_LIB} Qt::SvgWidgets Qt::WebEngineCore Qt::WebEngineWidgets)
else() elseif(ANDROID)
set(TARGET_LIB "Qt::Widgets" Qt::Quick Qt::QuickWidgets Qt::Svg Qt::Positioning Qt::Location) set(TARGET_LIB ${TARGET_LIB} Qt::SvgWidgets)
endif() endif()
else() else()
set(TARGET_NAME ${PLUGINSSRV_PREFIX}mapsrv) set(TARGET_NAME ${PLUGINSSRV_PREFIX}mapsrv)

View File

@ -18,7 +18,13 @@
#include <QOpenGLShaderProgram> #include <QOpenGLShaderProgram>
#include <QOpenGLFunctions> #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 <QOpenGLContext>
#include <QtOpenGL> #include <QtOpenGL>
#include <QImage> #include <QImage>

View File

@ -24,9 +24,13 @@
#include <QString> #include <QString>
#include <QOpenGLFunctions> #include <QOpenGLFunctions>
#if defined(ANDROID)
#include <QOpenGLFunctions_ES2>
#else
#include <QOpenGLFunctions_2_0> #include <QOpenGLFunctions_2_0>
#include <QOpenGLFunctions_2_1> #include <QOpenGLFunctions_2_1>
#include <QOpenGLFunctions_3_0> #include <QOpenGLFunctions_3_0>
#endif
#include <QOpenGLTexture> #include <QOpenGLTexture>
#include <QOpenGLShaderProgram> #include <QOpenGLShaderProgram>
#include <QOpenGLVertexArrayObject> #include <QOpenGLVertexArrayObject>