Qt web assembly: configure kit

前端 未结 2 940
别那么骄傲
别那么骄傲 2021-01-13 07:23

I want to test out QT WebAssembly for my scientific program. Therefore, I installed emscripten.

$em++ --version

returns

         


        
相关标签:
2条回答
  • 2021-01-13 08:12
    1. You need to copy the .emscripten file from emsdk directory to your home (/home/myUsername).

    2. You need to fix the paths in the file manually (See example below).

    Notice that .emscripten file , at least in the version (1.39.8) i am using, is a python script (maybe a bug?)

    example file before edit:

    import os
    emsdk_path = os.path.dirname(os.environ.get('EM_CONFIG')).replace('\\', '/')
    NODE_JS = emsdk_path + '/node/12.18.1_64bit/bin/node'
    LLVM_ROOT = emsdk_path + '/upstream/bin'
    BINARYEN_ROOT = emsdk_path + '/upstream'
    EMSCRIPTEN_ROOT = emsdk_path + '/upstream/emscripten'
    TEMP_DIR = emsdk_path + '/tmp'
    COMPILER_ENGINE = NODE_JS
    JS_ENGINES = [NODE_JS]
    

    after edit:

    import os
    emsdk_path = os.path.dirname(os.environ.get('EM_CONFIG')).replace('\\', '/')
    NODE_JS = '/home/myUsername/node/12.18.1_64bit/bin/node'
    LLVM_ROOT = '/home/myUsername/upstream/bin'
    BINARYEN_ROOT = '/home/myUsername/upstream'
    EMSCRIPTEN_ROOT = '/home/myUsername/upstream/emscripten'
    TEMP_DIR = '/home/myUsername/tmp'
    COMPILER_ENGINE = NODE_JS
    JS_ENGINES = [NODE_JS]
    

    When above steps are completed qt creator was able to detect the Emscripten Compiler with no errors.

    0 讨论(0)
  • 2021-01-13 08:17

    Have you try in the kits tab to set your compiler with this values?

    Compiler: C compiler x86 64 e1.38.27_bit C++ compiler x86 64 e1.38.27_bit

    Qt version: path to you qmake built with webassembly, for example webassembly binaries or your custom binaries.

    Qt mkspec: wasm-emscripten

    Hope this information helps, if you face any other problem let me know.

    0 讨论(0)
提交回复
热议问题