From b19a2235047e495ac72e20613fe517de71846ea5 Mon Sep 17 00:00:00 2001
From: Lorn Potter <lorn.potter@gmail.com>
Date: Thu, 3 Jan 2019 09:55:52 +1000
Subject: [PATCH] wasm: add support for webassembly

Need all benchmark qml files into resource because of sandbox.

Make subprocess-mode default for wasm
---
 .../comparison/moving-images-animations.qml   |   2 +-
 .../comparison/moving-images-animators.qml    |   2 +-
 .../comparison/moving-images-script.qml       |   2 +-
 .../comparison/moving-images-simple.qml       |   2 +-
 benchmarks/benchmarks.qrc                     | 176 ++++++++++++++++++
 benchmarks/manual/gputhroughput/drawcalls.qml |   2 +-
 shared.qrc                                    |  10 +
 src/benchmarkrunner.cpp                       |   2 +
 src/main.cpp                                  |  12 +-
 src/shared.qrc                                |   2 +
 src/src.pro                                   |   4 +-
 11 files changed, 206 insertions(+), 10 deletions(-)
 create mode 100644 benchmarks/benchmarks.qrc
 create mode 100644 shared.qrc
 create mode 100644 src/shared.qrc

diff --git a/benchmarks/auto/animations/comparison/moving-images-animations.qml b/benchmarks/auto/animations/comparison/moving-images-animations.qml
index b9ecb61..2dbdb23 100644
--- a/benchmarks/auto/animations/comparison/moving-images-animations.qml
+++ b/benchmarks/auto/animations/comparison/moving-images-animations.qml
@@ -12,7 +12,7 @@ Benchmark {
     Repeater {
         model: root.count
         Image {
-            source: "../../../../shared/butterfly-wide.png"
+            source: "qrc:/shared/butterfly-wide.png"
             x: QmlBench.getRandom() * (root.width - width)
             y: QmlBench.getRandom() * (root.height - height)
             width: 40
diff --git a/benchmarks/auto/animations/comparison/moving-images-animators.qml b/benchmarks/auto/animations/comparison/moving-images-animators.qml
index 132c61b..45a736d 100644
--- a/benchmarks/auto/animations/comparison/moving-images-animators.qml
+++ b/benchmarks/auto/animations/comparison/moving-images-animators.qml
@@ -12,7 +12,7 @@ Benchmark {
     Repeater {
         model: root.count
         Image {
-            source: "../../../../shared/butterfly-wide.png"
+            source: "qrc:/shared/butterfly-wide.png"
             x: QmlBench.getRandom() * (root.width - width)
             y: QmlBench.getRandom() * (root.height - height)
             width: 40
diff --git a/benchmarks/auto/animations/comparison/moving-images-script.qml b/benchmarks/auto/animations/comparison/moving-images-script.qml
index d2a2fcf..59f1e3b 100644
--- a/benchmarks/auto/animations/comparison/moving-images-script.qml
+++ b/benchmarks/auto/animations/comparison/moving-images-script.qml
@@ -12,7 +12,7 @@ Benchmark {
     Repeater {
         model: root.count
         Image {
-            source: "../../../../shared/butterfly-wide.png"
+            source: "qrc:/shared/butterfly-wide.png"
             x: QmlBench.getRandom() * (root.width - width)
             y: QmlBench.getRandom() * (root.height - height)
             width: 40
diff --git a/benchmarks/auto/animations/comparison/moving-images-simple.qml b/benchmarks/auto/animations/comparison/moving-images-simple.qml
index 1db6c6a..8a0f610 100644
--- a/benchmarks/auto/animations/comparison/moving-images-simple.qml
+++ b/benchmarks/auto/animations/comparison/moving-images-simple.qml
@@ -17,7 +17,7 @@ Benchmark {
     Repeater {
         model: root.count
         Image {
-            source: "../../../../shared/butterfly-wide.png"
+            source: "qrc:/shared/butterfly-wide.png"
             x: QmlBench.getRandom() * (root.width - width)
             y: QmlBench.getRandom() * (root.height - height)
             width: 40
diff --git a/benchmarks/benchmarks.qrc b/benchmarks/benchmarks.qrc
new file mode 100644
index 0000000..a1f7861
--- /dev/null
+++ b/benchmarks/benchmarks.qrc
@@ -0,0 +1,176 @@
+<RCC>
+    <qresource prefix="/">
+        <file alias="moving-images-animations.qml">auto/animations/comparison/moving-images-animations.qml</file>
+        <file alias="moving-images-animators.qml">auto/animations/comparison/moving-images-animators.qml</file>
+        <file alias="moving-images-script.qml">auto/animations/comparison/moving-images-script.qml</file>
+        <file alias="moving-images-simple.qml">auto/animations/comparison/moving-images-simple.qml</file>
+        <file alias="compositesingleton.qml">auto/bindings/compositesingleton.qml</file>
+        <file alias="canvas_text_simple.qml">auto/canvas/canvas_text_simple.qml</file>
+        <file alias="changing_over_isolated_with_clip_rotates.qml">auto/changes/changing_over_isolated_with_clip_rotated.qml</file>
+        <file alias="changing_over_isolated_with_clip.qml">auto/changes/changing_over_isolated_with_clip.qml</file>
+        <file alias="changing_over_isolated.qml">auto/changes/changing_over_isolated.qml</file>
+        <file alias="changing_text_oneofmany.qml">auto/changes/changing_text_oneofmany.qml</file>
+        <file alias="changing_texts.qml">auto/changes/changing_texts.qml</file>
+        <file alias="delegates_column.qml">auto/creation/layouts/delegates_column.qml</file>
+        <file alias="delegates_columnlayout.qml">auto/creation/layouts/delegates_columnlayout.qml</file>
+        <file alias="delegates_flow.qml">auto/creation/layouts/delegates_flow.qml</file>
+        <file alias="delegates_grid.qml">auto/creation/layouts/delegates_grid.qml</file>
+        <file alias="delegates_gridlayout.qml">auto/creation/layouts/delegates_gridlayout.qml</file>
+        <file alias="delegates_row.qml">auto/creation/layouts/delegates_row.qml</file>
+        <file alias="delegates_rowlayout.qml">auto/creation/layouts/delegates_rowlayout.qml</file>
+        <file alias="delegates_basictype_bool.qml">auto/creation/qml.basictypes/delegates_basictype_bool.qml</file>
+        <file alias="delegates_basictype_double.qml">auto/creation/qml.basictypes/delegates_basictype_double.qml</file>
+        <file alias="delegates_basictype_int.qml">auto/creation/qml.basictypes/delegates_basictype_int.qml</file>
+        <file alias="delegates_basictype_real.qml">auto/creation/qml.basictypes/delegates_basictype_real.qml</file>
+        <file alias="delegates_basictype_string.qml">auto/creation/qml.basictypes/delegates_basictype_string.qml</file>
+        <file alias="delegates_basictype_url.qml">auto/creation/qml.basictypes/delegates_basictype_url.qml</file>
+        <file alias="delegates_basictype_var_array.qml">auto/creation/qml.basictypes/delegates_basictype_var_array.qml</file>
+        <file alias="delegates_basictype_var_bool.qml">auto/creation/qml.basictypes/delegates_basictype_var_bool.qml</file>
+        <file alias="delegates_basictype_var_int.qml">auto/creation/qml.basictypes/delegates_basictype_var_int.qml</file>
+        <file alias="delegates_basictype_var_object.qml">auto/creation/qml.basictypes/delegates_basictype_var_object.qml</file>
+        <file alias="delegates_basictype_var_string.qml">auto/creation/qml.basictypes/delegates_basictype_var_string.qml</file>
+        <file alias="delegates_basictype_variant_array.qml">auto/creation/qml.basictypes/delegates_basictype_variant_array.qml</file>
+        <file alias="delegates_basictype_variant_bool.qml">auto/creation/qml.basictypes/delegates_basictype_variant_bool.qml</file>
+        <file alias="delegates_basictype_variant_int.qml">auto/creation/qml.basictypes/delegates_basictype_variant_int.qml</file>
+        <file alias="delegates_basictype_variant_object.qml">auto/creation/qml.basictypes/delegates_basictype_variant_object.qml</file>
+        <file alias="delegates_basictype_variant_string.qml">auto/creation/qml.basictypes/delegates_basictype_variant_string.qml</file>
+        <file alias="modelaccess_bool.qml">auto/creation/qml.modelaccess/modelaccess_bool.qml</file>
+        <file alias="modelaccess_bytearray.qml">auto/creation/qml.modelaccess/modelaccess_bytearray.qml</file>
+        <file alias="modelaccess_color.qml">auto/creation/qml.modelaccess/modelaccess_color.qml</file>
+        <file alias="modelaccess_datetime.qml">auto/creation/qml.modelaccess/modelaccess_datetime.qml</file>
+        <file alias="modelaccess_int.qml">auto/creation/qml.modelaccess/modelaccess_int.qml</file>
+        <file alias="modelaccess_jsvalue.qml">auto/creation/qml.modelaccess/modelaccess_jsvalue.qml</file>
+        <file alias="modelaccess_point.qml">auto/creation/qml.modelaccess/modelaccess_point.qml</file>
+        <file alias="modelaccess_real.qml">auto/creation/qml.modelaccess/modelaccess_real.qml</file>
+        <file alias="modelaccess_rect.qml">auto/creation/qml.modelaccess/modelaccess_rect.qml</file>
+        <file alias="modelaccess_size.qml">auto/creation/qml.modelaccess/modelaccess_size.qml</file>
+        <file alias="modelaccess_string.qml">auto/creation/qml.modelaccess/modelaccess_string.qml</file>
+        <file alias="modelaccess_url.qml">auto/creation/qml.modelaccess/modelaccess_url.qml</file>
+        <file alias="delegates_lineargradient.qml">auto/creation/qtgraphicaleffects/delegates_lineargradient.qml</file>
+        <file alias="delegates_flickable.qml">auto/creation/quick/delegates_flickable.qml</file>
+        <file alias="delegates_flipable.qml">auto/creation/quick/delegates_flipable.qml</file>
+        <file alias="delegates_focusscope.qml">auto/creation/quick/delegates_focusscope.qml</file>
+        <file alias="delegates_fontloader.qml">auto/creation/quick/delegates_fontloader.qml</file>
+        <file alias="delegates_fontmetrics.qml">auto/creation/quick/delegates_fontmetrics.qml</file>
+        <file alias="delegates_gridview.qml">auto/creation/quick/delegates_gridview.qml</file>
+        <file alias="delegates_listview.qml">auto/creation/quick/delegates_listview.qml</file>
+        <file alias="delegates_loader.qml">auto/creation/quick/delegates_loader.qml</file>
+        <file alias="delegates_mousearea.qml">auto/creation/quick/delegates_mousearea.qml</file>
+        <file alias="delegates_multipointtoucharea.qml">auto/creation/quick/delegates_multipointtoucharea.qml</file>
+        <file alias="delegates_pathview.qml">auto/creation/quick/delegates_pathview.qml</file>
+        <file alias="delegates_pincharea.qml">auto/creation/quick/delegates_pincharea.qml</file>
+        <file alias="delegates_qobject_large_array.qml">auto/creation/quick/delegates_qobject_large_array.qml</file>
+        <file alias="delegates_qobject.qml">auto/creation/quick/delegates_qobject.qml</file>
+        <file alias="delegates_shadereffect_props.qml">auto/creation/quick/delegates_shadereffect_props.qml</file>
+        <file alias="delegates_shadereffect.qml">auto/creation/quick/delegates_shadereffect.qml</file>
+        <file alias="delegates_shadereffectsource.qml">auto/creation/quick/delegates_shadereffectsource.qml</file>
+        <file alias="delegates_textmetrics.qml">auto/creation/quick/delegates_textmetrics.qml</file>
+        <file alias="delegates_basictype_color_argb.qml">auto/creation/quick.basictypes/delegates_basictype_color_argb.qml</file>
+        <file alias="delegates_basictype_color_name.qml">auto/creation/quick.basictypes/delegates_basictype_color_name.qml</file>
+        <file alias="delegates_basictype_color.qml">auto/creation/quick.basictypes/delegates_basictype_color.qml</file>
+        <file alias="delegates_basictype_date_object.qml">auto/creation/quick.basictypes/delegates_basictype_date_object.qml</file>
+        <file alias="delegates_basictype_date.qml">auto/creation/quick.basictypes/delegates_basictype_date.qml</file>
+        <file alias="delegates_basictype_matrix4x4.qml">auto/creation/quick.basictypes/delegates_basictype_matrix4x4.qml</file>
+        <file alias="delegates_basictype_point.qml">auto/creation/quick.basictypes/delegates_basictype_point.qml</file>
+        <file alias="delegates_basictype_quaternion.qml">auto/creation/quick.basictypes/delegates_basictype_quaternion.qml</file>
+        <file alias="delegates_basictype_rect.qml">auto/creation/quick.basictypes/delegates_basictype_rect.qml</file>
+        <file alias="delegates_basictype_size.qml">auto/creation/quick.basictypes/delegates_basictype_size.qml</file>
+        <file alias="delegates_basictype_var_size.qml">auto/creation/quick.basictypes/delegates_basictype_var_size.qml</file>
+        <file alias="delegates_basictype_variant_size.qml">auto/creation/quick.basictypes/delegates_basictype_variant_size.qml</file>
+        <file alias="delegates_basictype_vector2d.qml">auto/creation/quick.basictypes/delegates_basictype_vector2d.qml</file>
+        <file alias="delegates_basictype_vector3d.qml">auto/creation/quick.basictypes/delegates_basictype_vector3d.qml</file>
+        <file alias="delegates_basictype_vector4d.qml">auto/creation/quick.basictypes/delegates_basictype_vector4d.qml</file>
+        <file alias="delegates_canvas_fbo_cooperative.qml">auto/creation/quick.canvas/delegates_canvas_fbo_cooperative.qml</file>
+        <file alias="delegates_canvas_fbo_immediate.qml">auto/creation/quick.canvas/delegates_canvas_fbo_immediate.qml</file>
+        <file alias="delegates_canvas_fbo_threaded.qml">auto/creation/quick.canvas/delegates_canvas_fbo_threaded.qml</file>
+        <file alias="delegates_canvas_image_cooperative.qml">auto/creation/quick.canvas/delegates_canvas_image_cooperative.qml</file>
+        <file alias="delegates_canvas_image_immediate.qml">auto/creation/quick.canvas/delegates_canvas_image_immediate.qml</file>
+        <file alias="delegates_canvas_image_threaded.qml">auto/creation/quick.canvas/delegates_canvas_image_threaded.qml</file>
+        <file alias="delegates_busyindicator.qml">auto/creation/quick.controls2/delegates_busyindicator.qml</file>
+        <file alias="delegates_button.qml">auto/creation/quick.controls2/delegates_button.qml</file>
+        <file alias="delegates_checkbox.qml">auto/creation/quick.controls2/delegates_checkbox.qml</file>
+        <file alias="delegates_combobox.qml">auto/creation/quick.controls2/delegates_combobox.qml</file>
+        <file alias="delegates_dial.qml">auto/creation/quick.controls2/delegates_dial.qml</file>
+        <file alias="delegates_itemdelegate.qml">auto/creation/quick.controls2/delegates_itemdelegate.qml</file>
+        <file alias="delegates_menu_customdelegates_label.qml">auto/creation/quick.controls2/delegates_label.qml</file>
+        <file alias="delegates_menu_custom.qml">auto/creation/quick.controls2/delegates_menu_custom.qml</file>
+        <file alias="delegates_menuitem.qml">auto/creation/quick.controls2/delegates_menuitem.qml</file>
+        <file alias="delegates_progressbar.qml">auto/creation/quick.controls2/delegates_progressbar.qml</file>
+        <file alias="delegates_radiobutton.qml">auto/creation/quick.controls2/delegates_radiobutton.qml</file>
+        <file alias="delegates_scrollbar.qml">auto/creation/quick.controls2/delegates_scrollbar.qml</file>
+        <file alias="delegates_scrollview.qml">auto/creation/quick.controls2/delegates_scrollview.qml</file>
+        <file alias="delegates_slider.qml">auto/creation/quick.controls2/delegates_slider.qml</file>
+        <file alias="delegates_spinbox.qml">auto/creation/quick.controls2/delegates_spinbox.qml</file>
+        <file alias="delegates_switch.qml">auto/creation/quick.controls2/delegates_switch.qml</file>
+        <file alias="delegates_tabbar.qml">auto/creation/quick.controls2/delegates_tabbar.qml</file>
+        <file alias="delegates_textarea.qml">auto/creation/quick.controls2/delegates_textarea.qml</file>
+        <file alias="delegates_textfield.qml">auto/creation/quick.controls2/delegates_textfield.qml</file>
+        <file alias="delegates_tumbler.qml">auto/creation/quick.controls2/delegates_tumbler.qml</file>
+        <file alias="delegates_image_alpha.qml">auto/creation/quick.image/delegates_image_alpha.qml</file>
+        <file alias="delegates_image_antialiased.qml">auto/creation/quick.image/delegates_image_antialiased.qml</file>
+        <file alias="delegates_image_async.qml">auto/creation/quick.image/delegates_image_async.qml</file>
+        <file alias="delegates_image_solid.qml">auto/creation/quick.image/delegates_image_solid.qml</file>
+        <file alias="delegates_image.qml">auto/creation/quick.image/delegates_image.qml</file>
+        <file alias="delegates_item_bindings.qml">auto/creation/quick.item/delegates_item_bindings.qml</file>
+        <file alias="delegates_item_childrenRect.qml">auto/creation/quick.item/delegates_item_childrenRect.qml</file>
+        <file alias="delegates_item_empty_jscreation.qml">auto/creation/quick.item/delegates_item_empty_jscreation.qml</file>
+        <file alias="delegates_item_empty.qml">auto/creation/quick.item/delegates_item_empty.qml</file>
+        <file alias="delegates_item_script.qml">auto/creation/quick.item/delegates_item_script.qml</file>
+        <file alias="delegates_item_states.qml">auto/creation/quick.item/delegates_item_states.qml</file>
+        <file alias="qml.qml">auto/creation/quick.item/delegates_item_z.qml</file>
+        <file alias="delegates_item.qml">auto/creation/quick.item/delegates_item.qml</file>
+        <file alias="item_anchors.qml">auto/creation/quick.item/item_anchors.qml</file>
+        <file alias="item_size.qml">auto/creation/quick.item/item_size.qml</file>
+        <file alias="delegates_rect_blended.qml">auto/creation/quick.rectangle/delegates_rect_blended.qml</file>
+        <file alias="delegates_rect_border.qml">auto/creation/quick.rectangle/delegates_rect_border.qml</file>
+        <file alias="delegates_rect_gradient.qml">auto/creation/quick.rectangle/delegates_rect_gradient.qml</file>
+        <file alias="delegates_rect_radius.qml">auto/creation/quick.rectangle/delegates_rect_radius.qml</file>
+        <file alias="delegates_rect.qml">auto/creation/quick.rectangle/delegates_rect.qml</file>
+        <file alias="delegates_longtext_arabic.qml">auto/creation/quick.text/delegates_longtext_arabic.qml</file>
+        <file alias="delegates_longtext_chinese.qml">auto/creation/quick.text/delegates_longtext_chinese.qml</file>
+        <file alias="delegates_longtext_hindi.qml">auto/creation/quick.text/delegates_longtext_hindi.qml</file>
+        <file alias="delegates_longtext.qml">auto/creation/quick.text/delegates_longtext.qml</file>
+        <file alias="delegates_text_arabic.qml">auto/creation/quick.text/delegates_text_arabic.qml</file>
+        <file alias="delegates_text_chinese.qml">auto/creation/quick.text/delegates_text_chinese.qml</file>
+        <file alias="delegates_text_decoration_bold.qml">auto/creation/quick.text/delegates_text_decoration_bold.qml</file>
+        <file alias="delegates_text_decoration_italic.qml">auto/creation/quick.text/delegates_text_decoration_italic.qml</file>
+        <file alias="delegates_text_decoration_strikeout.qml">auto/creation/quick.text/delegates_text_decoration_strikeout.qml</file>
+        <file alias="delegates_text_decoration_underline.qml">auto/creation/quick.text/delegates_text_decoration_underline.qml</file>
+        <file alias="delegates_text_hindi.qml">auto/creation/quick.text/delegates_text_hindi.qml</file>
+        <file alias="delegates_text_nativerendering.qml">auto/creation/quick.text/delegates_text_nativerendering.qml</file>
+        <file alias="delegates_text_richtextdelegates_text_plain.qml">auto/creation/quick.text/delegates_text_plain.qml</file>
+        <file alias="delegates_text_richtext.qml">auto/creation/quick.text/delegates_text_richtext.qml</file>
+        <file alias="delegates_text_styled.qml">auto/creation/quick.text/delegates_text_styled.qml</file>
+        <file alias="delegates_text.qml">auto/creation/quick.text/delegates_text.qml</file>
+        <file alias="delegates_textedit.qml">auto/creation/quick.text/delegates_textedit.qml</file>
+        <file alias="delegates_textinput.qml">auto/creation/quick.text/delegates_textinput.qml</file>
+        <file alias="delegates_kerning.qml">auto/creation/quick.text/comparison/delegates_kerning.qml</file>
+        <file alias="delegates_nokerning.qml">auto/creation/quick.text/comparison/delegates_nokerning.qml</file>
+        <file alias="delegates_noshaping.qml">auto/creation/quick.text/comparison/delegates_noshaping.qml</file>
+        <file alias="delegates_item_rotated_transform.qml">auto/creation/quick.transforms/delegates_item_rotated_transform.qml</file>
+        <file alias="delegates_item_rotated.qml">auto/creation/quick.transforms/delegates_item_rotated.qml</file>
+        <file alias="delegates_item_scaled_transform.qml">auto/creation/quick.transforms/delegates_item_scaled_transform.qml</file>
+        <file alias="delegates_item_scaled.qml">auto/creation/quick.transforms/delegates_item_scaled.qml</file>
+        <file alias="delegates_item_translated.qml">auto/creation/quick.transforms/delegates_item_translated.qml</file>
+        <file alias="delegates_doublevalidator.qml">auto/creation/quick.validators/delegates_doublevalidator.qml</file>
+        <file alias="delegates_intvalidator.qml">auto/creation/quick.validators/delegates_intvalidator.qml</file>
+        <file alias="delegates_regexpvalidator">auto/creation/quick.validators/delegates_regexpvalidator.qml</file>
+        <file alias="fib10.qml">auto/js/fib10.qml</file>
+        <file alias="sum10k_fixed.qml">auto/js/sum10k_fixed.qml</file>
+        <file alias="sum10k.qml">auto/js/sum10k.qml</file>
+        <file alias="blendedrect.qml">manual/gputhroughput/blendedrect.qml</file>
+        <file alias="blendedtexture.qml">manual/gputhroughput/blendedtexture.qml</file>
+        <file alias="drawcalls.qml">manual/gputhroughput/drawcalls.qml</file>
+        <file alias="gaussblur.qml">manual/gputhroughput/gaussblur.qml</file>
+        <file alias="grapes.qml">manual/gputhroughput/grapes.jpg</file>
+        <file alias="opaquerect.qml">manual/gputhroughput/opaquerect.qml</file>
+        <file alias="opaquetexture.qml">manual/gputhroughput/opaquetexture.qml</file>
+        <file alias="v8-Crypto.qml">manual/v8bench/v8-Crypto.qml</file>
+        <file alias="v8-DeltaBlue.qml">manual/v8bench/v8-DeltaBlue.qml</file>
+        <file alias="8-EarleyBoyer.qml">manual/v8bench/v8-EarleyBoyer.qml</file>
+        <file alias="v8-RayTrace.qml">manual/v8bench/v8-RayTrace.qml</file>
+        <file alias="v8-RegExp.qml">manual/v8bench/v8-RegExp.qml</file>
+        <file alias="v8-Richards.qml">manual/v8bench/v8-Richards.qml</file>
+        <file alias="v8-Splay.qml">manual/v8bench/v8-Splay.qml</file>
+    </qresource>
+</RCC>
diff --git a/benchmarks/manual/gputhroughput/drawcalls.qml b/benchmarks/manual/gputhroughput/drawcalls.qml
index bdd6289..f5778bd 100644
--- a/benchmarks/manual/gputhroughput/drawcalls.qml
+++ b/benchmarks/manual/gputhroughput/drawcalls.qml
@@ -36,7 +36,7 @@ Item {
                     width: x + 2
                     height: y + 2
                     sourceSize: Qt.size(width, height);
-                    source: "../../../shared/butterfly-wide.png"
+                    source: "qrc:/shared/butterfly-wide.png"
                 }
             }
         }
diff --git a/shared.qrc b/shared.qrc
new file mode 100644
index 0000000..c8e7c57
--- /dev/null
+++ b/shared.qrc
@@ -0,0 +1,10 @@
+<RCC>
+    <qresource prefix="/">
+        <file>shared/butterfly-collapsed.png</file>
+        <file>shared/alpha.png</file>
+        <file>shared/butterfly-half.png</file>
+        <file>shared/butterfly-wide.png</file>
+        <file>shared/Globals.qml</file>
+        <file>shared/solid.png</file>
+    </qresource>
+</RCC>
diff --git a/src/benchmarkrunner.cpp b/src/benchmarkrunner.cpp
index 90c29a8..d6111ae 100644
--- a/src/benchmarkrunner.cpp
+++ b/src/benchmarkrunner.cpp
@@ -111,8 +111,10 @@ void BenchmarkRunner::start()
 
 void BenchmarkRunner::finished()
 {
+#ifndef Q_OS_WASM
     delete m_view;
     m_view = 0;
+#endif
     std::cerr << "All done..." << std::endl;
     qApp->quit();
 }
diff --git a/src/main.cpp b/src/main.cpp
index 91622d0..cd10202 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -155,8 +155,11 @@ QStringList processCommandLineArguments(const QCoreApplication &app)
     const QCommandLineOption &helpOption = parser.addHelpOption();
 
     parser.process(app);
-
+#ifdef Q_OS_WASM
+    Options::instance.isSubProcess = true;
+#else
     Options::instance.isSubProcess = parser.isSet(subprocessOption);
+#endif
 
     if (parser.isSet(jsonOption)) {
         Options::instance.printJsonToStdout = true;
@@ -411,7 +414,9 @@ int main(int argc, char **argv)
             break;
         }
     }
-
+#ifdef Q_OS_WASM
+    needsGui = true;
+#endif
     if (needsGui) {
         app.reset(new QGuiApplication(argc, argv));
     } else {
@@ -419,13 +424,12 @@ int main(int argc, char **argv)
     }
 
     QStringList positionalArgs = processCommandLineArguments(*app);
-
     int ret = 0;
-
     // qmlbench works as a split process mode. The parent process
     // (!isSubProcess) proxies a bunch of child processes that actually do the
     // work, and report output back to the parent. This keeps the benchmark
     // environment fairly clean.
+
     if (!Options::instance.isSubProcess) {
         ret = runHostProcess(*app, positionalArgs);
     } else {
diff --git a/src/shared.qrc b/src/shared.qrc
new file mode 100644
index 0000000..90f4a83
--- /dev/null
+++ b/src/shared.qrc
@@ -0,0 +1,2 @@
+<!DOCTYPE RCC>
+<RCC version="1.0"/>
diff --git a/src/src.pro b/src/src.pro
index 2e91e92..39ece4d 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -34,7 +34,9 @@ equals(QT_MAJOR_VERSION, 5): lessThan(QT_MINOR_VERSION, 2) {
 CONFIG += console
 CONFIG -= app_bundle
 
-RESOURCES += qmlbench.qrc
+RESOURCES += qmlbench.qrc \
+    ../shared.qrc
+RESOURCES += ../benchmarks/benchmarks.qrc
 
 target.path = /root
 INSTALLS += target
-- 
2.17.1

