jump to navigation

Using premake4 to build C/C++ projects November 28, 2009

Posted by Trezker in programming.
trackback

Build scripts have been my nemesis in C++ development ever since I started making projects with multiple files. I never got the logic of makefiles, sure the basics are simple enough but as soon as you want to do anything fancy it gets nasty.
For a long time I used IDE’s like Code::Blocks and MS visual studio that did the building for me, all I had to do was set some options in various menus. IDE’s also often have a good way to integrate testing and other fanciness. So I guess if you have a good IDE, and everyone you’re working with have the same IDE then all is good.

However, now I’m in Linux and as far as I have looked I can not find an IDE that’s good enough for me. One should pop up soon though, Linux is moving fast these days. Still, even if one did show up, it may not quite solve one problem. Namely, working with people who use other development environments!

Anyway, for me the most important issue is that I’m working without an IDE and I need a good simple way to write build scripts with all the bells and whistles. I found my way one week ago by googling build systems. The search turned up premake, I recognised the name because a friend had mentioned it before. After looking at it, I realised it was awesome.

Some points that should tell you why it is awesome:

  • Lua, you get a full scripting Language out of the box. With standard libraries!
  • Can generate build scripts for whatever IDE/platform/target you want.
  • Very logical structured description of projects and configurations.
  • Very easy to add custom commandline options and actions.

Check it out at http://industriousone.com/premake and you will experience joy.

In a future post I may share my library building script which demonstrates building, unit testing and installing.

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: