简体   繁体   English

在 WebAssembly 应用程序中存储版本

[英]Storing version in WebAssembly application

I've got REST service written in C++/Qt 5.15.x.我有用 C++/Qt 5.15.x 编写的 REST 服务。 Under some URL REST service sends WASM stuff.在某些 URL REST 服务下发送 WASM 内容。 It's a GUI application (REST client) written in C++/Qt 5.15.x.这是一个用 C++/Qt 5.15.x 编写的 GUI 应用程序(REST 客户端)。 It is possible to embed some function which shows version etc?可以嵌入一些显示版本等的 function 吗? I'd like to load wasm on the server side (Debian) in "bla-bla.wasm --version" style.我想以“bla-bla.wasm --version”样式在服务器端(Debian)加载wasm。 Or call some function from wasm via native REST service.或者通过本机 REST 服务从 wasm 调用一些 function。

In fact, REST service detects wasm renewal on the server side and will notify clients about new version via WebSocket.实际上,REST 服务在服务器端检测到 wasm 更新,并通过 WebSocket 通知客户端新版本。

I am using for similar purpose git describe sent through Makefile as compilation definition.我出于类似目的使用git describe通过 Makefile 作为编译定义发送。

In C++ there is a function which reads and parses string initialized with definition from Makefile (using as an input mentioned git output). In C++ there is a function which reads and parses string initialized with definition from Makefile (using as an input mentioned git output).

Makefile VERSION="-DVERSION_NUMBER=\"$(shell git describe)\"" Makefile VERSION="-DVERSION_NUMBER=\"$(shell git describe)\""

C++ std::string version(VERSION_NUMBER); C++ std::string version(VERSION_NUMBER);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM