webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.
https://webui.me
MIT License
2.95k stars 172 forks source link

help: is there a way to hide console/cmd ? #328

Closed jimying closed 7 months ago

jimying commented 7 months ago

as title

I know it's very helpful show console/cmd for debug, but i want to hide it when release.

jimying commented 7 months ago
 /SUBSYSTEM:Windows
 /SUBSYSTEM:Console

for zig build, set subsystem in build.zig

if (optimize != .Debug) exe.subsystem = .Windows;
AlbertShown commented 7 months ago

@jinzhongjia

jinzhongjia commented 7 months ago

@jinzhongjia

I did not set this in the example because it is convenient for debugging. If set this, it will not be able to directly see the output of the console.

AlbertShown commented 7 months ago

Probably default should be release, while for debugging, users can add debug argument in CLI. Just a suggestion.

jinzhongjia commented 7 months ago

Probably default should be release, while for debugging, users can add debug argument in CLI. Just a suggestion.

This build option is part of build.zig, it is decided by the user, it should not be provided by the package, and as an imported package, it is theoretically impossible to modify the settings of the package that imports it.

jinzhongjia commented 7 months ago

This is inconsistent with zig's non-implicit philosophy

jinzhongjia commented 7 months ago

But we can put it in the zig-webui readme as tips.