webui icon indicating copy to clipboard operation
webui copied to clipboard

Draft: Add CMake build system

Open NicolasBFR opened this issue 1 year ago • 7 comments

Add CMake build system

New CMakeLists.txt to let users build the libraries using CMake Build CivetWeb and then use it to build WebUI

NicolasBFR avatar Jan 20 '24 19:01 NicolasBFR

For some reason the linking works fine on all Linux compilers but fails on the _mg_websocket_write symbol linking. Anyone have any idea ?

NicolasBFR avatar Jan 20 '24 23:01 NicolasBFR

Do you mean this problem with cmake ? I am currently developing under arch linux, and the original makefile and zig builds are fine And to be honest, I don't like cmake

jinzhongjia avatar Jan 21 '24 02:01 jinzhongjia

I don't use cmake either, but if a PR provides a fully working cmake script, then it will be welcomed as for sure many people may prefer cmake over makefile/zig.

On the other hand, webui is simple, one .c file, so cmake may be overkill, in my opinion.

AlbertShown avatar Jan 22 '24 14:01 AlbertShown

I suggest providing CMakeLists.txt only while keeping the original CI (GitHub Workflow) untouched as it's working fine now. cmake is like the zig build, is an extra if anyone needs it.

Thank you @NicolasBFR for this PR by the way 👍

AlbertShown avatar Jan 22 '24 14:01 AlbertShown

I suggest providing CMakeLists.txt only while keeping the original CI (GitHub Workflow) untouched as it's working fine now. cmake is like the zig build, is an extra if anyone needs it.

@AlbertShown

I just wanted to make sure it would technically work for all platforms, unfortunately there is a linker error and I have no Mac or Windows installation to debug it.

CMake is obviously not necessary for a small project like this, but I needed it to import the webui target in a bigger project (AI inference application).

It builds fine on Arch Linux and Ubuntu, should I remove the CI changes, squash history and remove the draft status of the PR ?

NicolasBFR avatar Jan 22 '24 14:01 NicolasBFR

Don't worry, we need to wait @hassandraga for a decision

jinzhongjia avatar Jan 22 '24 14:01 jinzhongjia

On the other hand, webui is simple, one .c file, so cmake may be overkill, in my opinion.

This is really not transparent from reading the README tbh. If using WebUI is as simple as adding a single .c file in a project, I would suggest this to be advertised in the README instead of only showing an opinionated build process. That would likely refrain many people from thinking "ok, where is the CMakeFile" or whetever other build system they want to use.

eliemichel avatar Mar 19 '24 19:03 eliemichel