Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is currently the best build system [closed]

A few years ago I looked into using some build system that isnt Make, and tools like CMake and SCons seemed pretty primitive. I'd like to find out if the situation has improved. So, under the following criteria, what is currently the best build tool:

  • platform agnostic: should work on windows, linux, mac
  • language agnostic: should have built-in support for common things like building C/C++ and other static langs. I guess it doesn't need to support the full autotools suite.
  • extensible: I need to be able to write rules to generate files, like from restructuredText, latex, custom formats, etc. I dont really care what language I have to write the rules in, but I would prefer a real language rather than a DSL.
  • I would prefer to avoid writing any XML by hand, which I think for example ant requires.
  • Freely available (preferably open source)

The term "best" is slightly subjective, but I think answers can be rated objectively by the criteria above.

like image 283
Paul Biggar Avatar asked Dec 18 '09 18:12

Paul Biggar


People also ask

What is the best construction system for a self-build extension?

However, SIPs (structural insulated panels), oak frame, ICF (insulating concrete formwork), steel frame and even natural construction materials such as straw bale and cob, are increasingly popular choices for the self builder and the extender. Here we summarise what to consider before choosing a construction system.

What type of input files does buildbuilds use?

Builds only use input files that are explicitly declared in the build specification. On Linux, Bazel runs tools in a sandboxed environment that contain only the minimum necessary files required.

Why is the build system so complicated?

The build system has a tendency to be more complex than the actual projects that it's being used to build. It's a standard tool built over standard tools. A solid tool and a de-facto standard.

What are the different types of construction systems?

Choosing a construction system is one of the key decisions made when building a new home or extending an existing property. The choice traditionally came down to two main options: timber frame and masonry.


2 Answers

I'd definitively put my vote up for premake. Although it is not as powerful as it's older brothers, it's main advantage is absurd simplicity and ease of use. Makes writing multi-compiler, multi-platform code a breeze, and natively generates Visual Studio solutions, XCode projects, Makefiles, and others, without any additional work needed.

like image 90
Kornel Kisielewicz Avatar answered Oct 14 '22 00:10

Kornel Kisielewicz


So, judging purely by the criteria set forth in the question, the build system that seems like the best fit is probably waf - pure Python, provides support for C++ and other languages, general, powerful, not a DSL.


However, from my personal experience, I prefer CMake for C++ projects. (I tried CMake, SCons, and waf, and liked them in roughly that order). CMake is a general solution, but it has built-in support for C++ that makes it nicer than a more generic solution when you're actually doing C++.

CMake's build model for C++ is more declarative and less imperative, and thus, to me, easier to use. The CMake language syntax isn't great, but a declarative build with odd syntax beats an imperative build in Python. Of the three, CMake also seems to have the best support for "advanced" things like precompiled headers. Setting up precompiled headers reduced my rebuild time by about 70%.

Other pluses for CMake include decent documentation and a sizable community. Many open source libraries have CMake build files either in-tree or provided by the CMake community. There are major projects that already use CMake (OGRE comes to mind), and other major projects, like Boost and LLVM, are in the process of moving to CMake.

Part of the issue I found when experimenting with build systems is that I was trying to build a NPAPI plugin on OS X, and it turns out that very few build systems are set up to give XCode the exact combination of flags required to do so. CMake, recognizing that XCode is a complex and moving target, provides a hook for manually setting commands in generated XCode projects (and Visual Studio, I think). This is Very Smart as far as I'm concerned.

Whether you're building a library or an application may also determine which build system is best. Boost still uses a jam-based system, in part because it provides the most comprehensive support for managing build types that are more complex than "Debug" and "Release." Most boost libraries have five or six different versions, especially on Windows, anticipating people needing compatible libraries that link against different versions of the CRT.

I didn't have any problems with CMake on Windows, but of course your mileage may vary. There's a decent GUI for setting up build dependencies, though it's clunky to use for rebuilds. Luckily there's also a command-line client. What I've settled on so far is to have a thin wrapper Makefile that invokes CMake from an objdir; CMake then generates Makefiles in the objdir, and the original Makefile uses them to do the build. This ensures that people don't accidentally invoke CMake from the source directory and clutter up their repository. Combined with MinGW, this "CMake sandwich" provides a remarkably consistent cross-platform build experience!

like image 36
Ben Karel Avatar answered Oct 13 '22 23:10

Ben Karel