How make qt for wasm generate source map file using CMake?
-
wrote on 23 Aug 2024, 03:28 last edited by
I tested with Qt 6.5.3/6.7.2 (installed via Qt Online Installer) on linux, but none generates the source map for my c++ code.
š Help! -
wrote on 23 Aug 2024, 07:07 last edited by Paul Colby
Hi @Sauntor, I've never used a source map file, so can't validate, but I added this to a demo Qt project's
CMakeLists.txt
file:if(EMSCRIPTEN) message(STATUS "This is an Emscripten build; adding source-map options.") add_compile_options(-gsource-map) add_link_options(-gsource-map) endif()
An it resulted in a corresponding
<project-name>.wasm.map
file being produced when building with a Qt 6.8.0 for WebAssembly (from the Online Installer).Cheers.
-
Hi @Sauntor, I've never used a source map file, so can't validate, but I added this to a demo Qt project's
CMakeLists.txt
file:if(EMSCRIPTEN) message(STATUS "This is an Emscripten build; adding source-map options.") add_compile_options(-gsource-map) add_link_options(-gsource-map) endif()
An it resulted in a corresponding
<project-name>.wasm.map
file being produced when building with a Qt 6.8.0 for WebAssembly (from the Online Installer).Cheers.
wrote on 24 Aug 2024, 07:30 last edited by@Paul-Colby Thanks! It works, but it's still unable to debug the c++ code in the browser's devetools console, it seems the source map file does not work correctly for .wasm, all variables still stays in a format like var0, var1,...š
C/C++ DevTools Support extension not works too
1/3