Skip to content

Commit

Permalink
Add support for Qt Wasm
Browse files Browse the repository at this point in the history
WebAssembly uses OpenGL ES, so detect it in build config.

Fixes issue #38.
  • Loading branch information
kgron committed Jun 7, 2020
1 parent cb7762a commit 8a74ead
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libqnanopainter/include.pri
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,18 @@ win32 {
}

# When building for embedded devices you can define manually which
# backend is supported
# backends are supported
#DEFINES += QNANO_BUILD_GLES_BACKENDS
#DEFINES += QNANO_BUILD_GL_BACKENDS

# Alternatively, trying to autodetect suitable backeds based on Qt configuration
!contains(DEFINES, QNANO_BUILD_GL_BACKENDS) : !contains(DEFINES, QNANO_BUILD_GLES_BACKENDS) {
equals(QT_ARCH,"wasm") {
# WebAssembly uses GLES
DEFINES += QNANO_BUILD_GLES_BACKENDS
}
}

!contains(DEFINES, QNANO_BUILD_GL_BACKENDS) : !contains(DEFINES, QNANO_BUILD_GLES_BACKENDS) {
qtConfig(opengles2) | qtConfig(opengles3) {
DEFINES += QNANO_BUILD_GLES_BACKENDS
Expand Down

0 comments on commit 8a74ead

Please sign in to comment.