Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. How make qt for wasm generate source map file using CMake?
Forum Updated to NodeBB v4.3 + New Features

How make qt for wasm generate source map file using CMake?

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
3 Posts 2 Posters 525 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sauntor
    wrote on 23 Aug 2024, 03:28 last edited by
    #1

    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!

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Paul Colby
      wrote on 23 Aug 2024, 07:07 last edited by Paul Colby
      #2

      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.

      S 1 Reply Last reply 24 Aug 2024, 07:30
      0
      • P Paul Colby
        23 Aug 2024, 07:07

        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.

        S Offline
        S Offline
        Sauntor
        wrote on 24 Aug 2024, 07:30 last edited by
        #3

        @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 Reply Last reply
        0

        3/3

        24 Aug 2024, 07:30

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved