Assert Failure in expandVariableReferences When Configuring Qt 5 for WebAssembly Build
-
@lorn-potter Thanks for the reply.
I tried to configure by running:
configure -no-warnings-are-errors -xplatform wasm-emscripten -platform win32-g++ -nomake examples -prefix qtbase -DLLVM_INSTALL_DIR=C:/emsdk/upstream/bin -DZLIB_LIBRARY=C:/zlib/lib/zlibstatic.lib --device-option WASM_OBJECT_FILES=1
and had this error:
ERROR: No value supplied to command line option 'device-option'. ERROR: Assigning unknown variable 'WASM_OBJECT_FILES' on command line.
and then I passed the option as
--device-option="WASM_OBJECT_FILES=1"
and it this happened:Running configuration tests... Project ERROR: Unknown feature object shared in expression '!features.shared'.
What's the correct way to pass that option? Also, how do I tell it the location of zlib correctly? And if I want it to use the LLVM/Clang that's in the EMSDK, did I pass the flag correctly for that?
-
Sorry, it is: -device-option WASM_OBJECT_FILES=1
No need to pass extra arguments, this instructs emscripten to use the new clang backend to output wasm files directly, instead of outputting javascript before transpiling that to wasm.Qt uses its own zlib, the emscripten zlib is too old and may have issues with Qt. Safest to use the built-in zlib.
-
I actually built my own zlib. That's what I'm trying to use.
What about LLVM path, though? Is it okay to give the path to the one used by Emscripten? It's LLVM 10.
-
@DragonOsman said in Assert Failure in expandVariableReferences When Configuring Qt 5 for WebAssembly Build:
I actually built my own zlib. That's what I'm trying to use.
What about LLVM path, though? Is it okay to give the path to the one used by Emscripten? It's LLVM 10.
You shouldn't need to pass any llvm path, emscripten does all the magic.
-
I want to pass the path to LLVM to it because of this warning:
WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation. Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation. On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution. On macOS, you can use Homebrew's llvm package. On Windows, you must set LLVM_INSTALL_DIR to the installation path.
Also, do I need to build qtwebengine for Qt for WebAssembly or am I going to be fine without it?
-
@DragonOsman said in Assert Failure in expandVariableReferences When Configuring Qt 5 for WebAssembly Build:
I want to pass the path to LLVM to it because of this warning:
WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.
Do you need to build the docs? Otherwise you can ignore this warning.
Also, do I need to build qtwebengine for Qt for WebAssembly or am I going to be fine without it?
Depends on which modules you are going to actually use.
I usually only build qtbase, qtdeclarative, qtquickcontrols2, and maybe one or two others. -
I still don't actually understand what modules I need. For now I'm just thinking of building all of the ones tested and known to be good for Wasm.
-
@lorn-potter The build completed a few minutes ago with the command
mingw32-make module-qtbase module-qtdeclarative module-qtquickcontrols2 module-qtwebsockets module-qtsvg module-qtcharts module-qtmqtt
and I got this at the end:
mingw32-make: *** No rule to make target 'module-qtmqtt'. Stop.
I'll rerun it and this time I'll redirect the output to a file so I show it to you.
Edit: Okay, I can't get a file for the full output. I'll have to make do with what I have from the initial run which isn't the whole thing. https://gist.github.com/DragonOsman/6bbe1f3e8035566104f85ecf76e2173e . I have the environment variable EMCC_DEBUG set to 1, so I also the Emcripten debug output in there.
-
And just now I tried using the Qt I just built to build the Notepad project again. Here's the result: https://gist.github.com/DragonOsman/14cc0ce690f1c5ac1e76ae796741398f . There's still one .obj file that isn't determined to be of machine-type of wasm32. Any ideas on how I can fix this? Thanks in advance.
-
I think the reason for the Assert Failure errors is that I forgot to delete the files in the qtbase folder after a given build attempt. I think that's fixed now, but I still have some issues in building Qt so I'll open a thread now.