wasm: fix drag examples for webassembly

Change-Id: I47903743685fadfe33820e7785b72d62109e77d0
Pick-to: 6.7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Lorn Potter 2023-12-14 09:00:31 +10:00
parent ec98afd192
commit 39f81d14c1
4 changed files with 15 additions and 1 deletions

View File

@ -30,6 +30,11 @@ target_link_libraries(draggableicons PRIVATE
Qt6::Widgets Qt6::Widgets
) )
if(EMSCRIPTEN)
target_link_options(draggableicons PUBLIC -sASYNCIFY -Os)
endif()
# Resources: # Resources:
set(draggableicons_resource_files set(draggableicons_resource_files
"images/boat.png" "images/boat.png"

View File

@ -4,7 +4,9 @@ HEADERS = dragwidget.h
RESOURCES = draggableicons.qrc RESOURCES = draggableicons.qrc
SOURCES = dragwidget.cpp \ SOURCES = dragwidget.cpp \
main.cpp main.cpp
wasm {
QMAKE_LFLAGS += -sASYNCIFY -Os
}
# install # install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/draggableicons target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/draggableicons
INSTALLS += target INSTALLS += target

View File

@ -30,6 +30,10 @@ target_link_libraries(draggabletext PRIVATE
Qt6::Widgets Qt6::Widgets
) )
if(EMSCRIPTEN)
target_link_options(draggabletext PUBLIC -sASYNCIFY -Os)
endif()
# Resources: # Resources:
set(draggabletext_resource_files set(draggabletext_resource_files
"words.txt" "words.txt"

View File

@ -4,6 +4,9 @@ HEADERS = dragwidget.h
RESOURCES = draggabletext.qrc RESOURCES = draggabletext.qrc
SOURCES = dragwidget.cpp \ SOURCES = dragwidget.cpp \
main.cpp main.cpp
wasm {
QMAKE_LFLAGS += -sASYNCIFY -Os
}
# install # install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/draggabletext target.path = $$[QT_INSTALL_EXAMPLES]/widgets/draganddrop/draggabletext