wasi-libc
wasi-libc copied to clipboard
Migrate build system to CMake
I understand that a great thing about Makefile (versus CMake) is less dependencies. However, I see it comes with its own limitations, like not great Windows support, lack of ninja build (if that's preferred) or a bit obscure syntax (although that's very subjective). I've seen a PR https://github.com/WebAssembly/wasi-libc/pull/154/ although that seemed abandoned. Not sure if there was any reason for that or was it simply lost of interest? I'd be happy to pick up the work and finish it unless there was a reason to keep Makefiles.
I think its fairly subjective. The windows support is probably the most significant reason to switch. But also, non of those issues are really blocking progress or holding is back right now so it doesn't seem like we should be prioritizing this.
@sbc100 thanks for the comment. I agree that doesn't block any of the development, but it might slightly improve development experience as well (e.g. https://github.com/WebAssembly/wasi-libc/issues/156). Given there are no objections, I might pick up the branch and update the PR (or create a new one, if I'm unable to update the existing one) - otherwise, I'll keep the issue open so others can work on at one point of time.
As you might have guessed I'm not a huge fan of cmake.. but I don't know of any good alternatives. I would imagine that converting to cmake could make things more/needlessly complex, but if you can find a way to do it without too much extra complexity and without loosing in features, then I don't block it.
The fact the the previous attempt stall makes me things it could be somewhat challenging.
I support migrating to CMake. I'm not familiar enough with CMake enough to be of much direct help, but I'm happy to answer any question about what the current Makefile is doing.
One more usage for Cmake is CPM: add all dependencies including was-libc, llvm#{cxx,c++abi,compiler-rt}, third-party libs and everything gets cross compiled nicely.
Work seems to be stopped, so maybe I could help to finish this. A couple of questions:
- right now cmake files added out-of-sources: is there any strong reason to do in that way instead of place CMakeLists.txt directly next to source files in each directory?
- are there any other issues/requirenments/notes not mentioned in the #330 review?
@alexcrichton and I were just talking about this. Like @sbc100, I was originally more inclined here and in wasi-sdk to stick with the "tried and true" Makefile approach but there's good reasons to switch to CMake: (1) it does make the Windows build experience more robust and (2) the Makefile approach only makes sense to me when the build is simple — both wasi-sdk and wasi-libc may be complex enough now to justify CMake.