Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-118228

Bulding a WebAssembly application fails if emsdk path contains spaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6
    • Build System: CMake
    • None
    • WebAssembly, Windows

    Description

      Not sure if this is Qt build system issue, or a CMake issue or even emsdk.

      If my emsdk path contains spaces, the configuration of the project succeeds, but the build fails during an cmake_autogen step.

      Here the full_build_output.log , and here the output of the isolated, failing cmake call:

      -E cmake_autogen call
      C:\Users\alportal\Documents\untitled>"C:\Program Files\CMake\bin\cmake.exe" -E cmake_autogen C:/Users/alportal/Documents/{8b55fea1-4bce-4552-873b-4a66dec0ede7}/CMakeFiles/untitled_autogen.dir/AutogenInfo.json Debug
      
      AutoMoc subprocess error
      ------------------------
      The content generation command for "BIN:/untitled_autogen/moc_predefs.h" failed.
      Process failed with return value 1
      
      Command
      -------
      "C:/Users/alportal/dev/e m s d k - 3.1.14/upstream/emscripten/em++.bat" -std=gnu++17 -dM -E -c "C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeCXXCompilerABI.cpp" -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -IC:/Qt/6.4.3/wasm_32/include/QtCore -IC:/Qt/6.4.3/wasm_32/include -IC:/Qt/6.4.3/wasm_32/mkspecs/wasm-emscripten -IC:/Qt/6.4.3/wasm_32/include/QtWidgets -IC:/Qt/6.4.3/wasm_32/include/QtGui "-IC:/Users/alportal/dev/e m s d k - 3.1.14/upstream/emscripten/cache/sysroot/include"
      
      Output
      ------
      'C:/Users/alportal/dev/e' is not recognized as an internal or external command,
      operable program or batch file.
      

      The printed "Command" works for me if I paste it into a console. I have the impression that CMake does not quote the full executable name "C:/Users/alportal/dev/e m s d k - 3.1.14/upstream/emscripten/em++.bat" when executing it.

      MOC_PREDEFS_CMD in AutogenInfo.json
      ...
      	"MOC_PREDEFS_CMD" : 
      	[
      		"C:/Users/alportal/dev/e m s d k - 3.1.14/upstream/emscripten/em++.bat",
      		"-std=gnu++17",
      		"-dM",
      		"-E",
      		"-c",
      		"C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeCXXCompilerABI.cpp"
      	],
      ...
      

      Attachments

        1. full_build_output.log
          2 kB
          Alessandro Portale
        2. AutogenInfo.json
          28 kB
          Alessandro Portale

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtbuildsystem Qt Build System Team
              portale Alessandro Portale
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes