Configuring 6.2 for WebAssembly debugging
-
Following https://doc-snapshots.qt.io/qt6-dev/wasm.html
Which prescribes:
./configure -qt-host-path /path/to/Qt/6.2.0/platform -xplatform wasm-emscripten -prefix $PWD/qtbase
and
Source maps for stepping through code, can be created by reconfiguring Qt with the --device-option QT_WASM_SOURCE_MAP=1, and building a debug build.
Lead to this:
./configure -qt-host-path /home/anon/Library/qt6.2 -xplatform wasm-emscripten -debug -prefix $PWD/qtbase -device-option QT_WASM_SOURCE_MAP=1
Which produced this, and a similar error on 6.1
+ mkdir -p qtbase + cd qtbase + exec /home/anon/Library/qt6.2wasm/qtbase/configure -top-level -qt-host-path /home/anon/Library/qt6.2 -xplatform wasm-emscripten -debug -prefix /home/anon/Library/qt6.2wasm/qtbase -device-option QT_WASM_SOURCE_MAP=1 '/usr/local/bin/cmake' '-DQT_HOST_PATH=/home/anon/Library/qt6.2' '-DCMAKE_INSTALL_PREFIX=/home/anon/Library/qt6.2wasm/qtbase' '-DQT_QMAKE_TARGET_MKSPEC=wasm-emscripten' '-DCMAKE_BUILD_TYPE=Debug' '-DQT_QMAKE_DEVICE_OPTIONS=QT_WASM_SOURCE_MAP=1' '-G' 'Ninja' '/home/anon/Library/qt6.2wasm' Checking dependencies of 'qtbase' Checking dependencies of 'qtshadertools' Checking dependencies of 'qtsvg' Checking dependencies of 'qtdeclarative' Checking dependencies of 'qt3d' Checking dependencies of 'qt5compat' Checking dependencies of 'qtactiveqt' Checking dependencies of 'qtimageformats' Checking dependencies of 'qtquickcontrols2' Checking dependencies of 'qtmultimedia' Checking dependencies of 'qtcharts' Checking dependencies of 'qtcoap' Checking dependencies of 'qtconnectivity' Checking dependencies of 'qtdatavis3d' Checking dependencies of 'qttools' Checking dependencies of 'qtdoc' Checking dependencies of 'qtserialport' Checking dependencies of 'qtlocation' Checking dependencies of 'qtlottie' Checking dependencies of 'qtmqtt' Checking dependencies of 'qtnetworkauth' Checking dependencies of 'qtopcua' Checking dependencies of 'qtqa' Checking dependencies of 'qtquicktimeline' Checking dependencies of 'qtquick3d' Checking dependencies of 'qtremoteobjects' Checking dependencies of 'qtscxml' Checking dependencies of 'qtsensors' Checking dependencies of 'qtserialbus' Checking dependencies of 'qttranslations' Checking dependencies of 'qtvirtualkeyboard' Checking dependencies of 'qtwayland' Checking dependencies of 'qtwebsockets' Checking dependencies of 'qtwebchannel' Checking dependencies of 'qtwebengine' Checking dependencies of 'qtwebview' Configuring 'qtbase' CMake Error at qtbase/cmake/QtSetup.cmake:179 (find_package): Could not find a package configuration file provided by "Qt6HostInfo" with any of the following names: Qt6HostInfoConfig.cmake qt6hostinfo-config.cmake Add the installation prefix of "Qt6HostInfo" to CMAKE_PREFIX_PATH or set "Qt6HostInfo_DIR" to a directory containing one of the above files. If "Qt6HostInfo" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): qtbase/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:229 (include) qtbase/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:372 (qt_build_internals_set_up_private_api) qtbase/CMakeLists.txt:74 (qt_build_repo_begin) -- Configuring incomplete, errors occurred! See also "/home/anon/Library/qt6.2wasm/CMakeFiles/CMakeOutput.log". CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:937 (message): CMake exited with code 1.
When looking for the file, a Readme states:
If this directory is empty, you probably forgot to compile the Qt library.
I am not sure what to do.
-
I figured out what was wrong. I needed this command instead:
./configure -qt-host-path /home/anon/Library/qt6.2/qtbase -xplatform wasm-emscripten -debug -prefix $PWD/qtbase -device-option QT_WASM_SOURCE_MAP=1
-
Okay it compiles, but it ends up with the wrong ABI.
-
Did you build the qt6.2 host libraries?
You might need to also specify the emscripten toolchain file path
-DCMAKE_TOOLCHAIN_FILE='$HOME'/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake'Or where ever it is
-
Did you build the qt6.2 host libraries?
I do not believe so, but I'm not sure what the host libraries are supposed to be.
-DCMAKE_TOOLCHAIN_FILE='$HOME'/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake'
I'll give it another shot.
-
It did not work. I used this line to configure:
./configure -DCMAKE_TOOLCHAIN_FILE='$HOME'/Library/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -qt-host-path /home/anon/Library/qt6.2/qtbase -xplatform wasm-emscripten -debug -prefix $PWD/qtbase -device-option QT_WASM_SOURCE_MAP=1
When I upload the Qt version into QtCreator, the ABI is always
x86-linux-generic-elf-64bit
Instead of
asmjs-unknown-unknown-emscripten-32bit
Preventing any build.