rxi / lite

A lightweight text editor written in Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there any reason cmake/premake/make/ninja isn't used in this project?

wbehrens-on-gh opened this issue · comments

Just seems odd having a custom build script as the project inevitably grows. I'd vote on cmake mainly due to how common it already is. It would also allow to keep multiplatform support.

Why the build script has to inevitably grow? The build script did not change almost since the release of the project.
The project already has multi-platform support without those build systems.
What is the problem you would solve by adding a build system like that? Looks like adding complexity without a reason.

Commenting just for the pleasure of discussing. I don't think this is a real issue for lite and there are little chances that rxi changes his mind about that.

I cannot speak for rxi but it is in his style to favor simplicity over complexity especially when the complexity doesn't bring any added value.

For example cmake is an additional dependencies that needs to be satisfied and cmake brings a lot of annoying, unneeded complexity. I know this first hand having worked to build many C/C++ projects using cmake. I always advice against using cmake even if unfortunately it is now a sort of standard for C++. As for Makefiles, they are nowadays technically obsolete and for a simple project like lite they don't bring any real added value because compiling the whole project is very fast anyway.

For the lite editor the build script seems to be an acceptable solution because it is comprised of only an handful of C code that needs compilation and the rest are plain Lua files. In addition the C code is not using any non-standard feature or extension so you don't need any special build system support.

The only criticism one may have is that the SDL2 library is bundled already compiled as a DLL on windows. This may seem unorthodox but in practice it works well.

For lite-xl, I am the author, I choose Meson for the main reason that I brought the AGG library and Meson is helpful to tame the additional complexity of AGG codebase which is in C++. As a bonus with Meson I can better manage the external dependencies, freetype2 and SDL2 and build with the same config on Linux, Windows and Mac OS X. In addition Meson uses Ninja as a backed and it is very fast.

On the other side I am aware that Meson is an additional dependency that needs to be satisfied and in turns it needs a python install, which is not nothing but overall for me the advantages exceeds the costs. I got some feedback from lite-xl linux users and they are able to easily compile with Meson with essentially no problems.

If it was not for AGG I could have kept the script for building lite-xl. For lite itself I would have added the Meson config alongside the build script so that everyone can use what he prefers. The meson config is very unobtrusive and simple to read and to understand so it makes no harm anyway.

Just my two cents!

commented

What is the problem you would solve by adding a build system like that? Looks like adding complexity without a reason.
to put it simply: adoption

as it stands the build script works just fine for someone self compiling but for anything beyond that it gets complicated

  • cross compilation with a diferent mingw compiler essentially requires you to modify build.sh before compiling
  • existing CFLAGS and LFLAGS are ignored meaning packaging for most distros requires modification
    linking is essentially done by fetching any object file found
  • usage of -O3 will at best make it faster at worst cause UB that will cause a crash. GCC seems to be the prefered compiler but personally I have seen it make less sane decisions over time

there is beauty in simplicity but either the scripts need to become more fleshed out or simple CMake or Makefile support should be added