Which build system is best for cross-platform development?

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
david_mtl
Earned a small fee
Earned a small fee
Posts: 20
Joined: Fri Jan 10, 2020 4:13 pm

Which build system is best for cross-platform development?

Post by david_mtl »

Hi everyone,

I'm evaluating which build system is best for cross-platform development (win/linux/mac) as of 2020.

At first, I thought I could use Code Block and have multiple build target but then I found out that it doesn't have a recent port for Mac... I could try Codelite but I'd like to separate the process from an IDE.

So now I enter the ever changing world of build systems, and there's quite a lot of choices. Bakefiles seems to be the "not quite official but almost" build system for wxWidgets, is this the preferred option? I also see it's supported by a single person, huge respect, but I'm concerned about the long term viability of the project. CMake would probably work but I'm concerned about the steep learning curve.

I'm curious what others are using. As mentioned, I'll target Windows 32/64, Linux and Mac.

Thanks,
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Which build system is best for cross-platform development?

Post by DavidHart »

Hi,

Not an answer for your question, but:
I could try Codelite but I'd like to separate the process from an IDE.
CodeLite lets you set Custom Build settings, so whatever you decide you want to use, you can.
Bakefiles seems to be the "not quite official but almost" build system for wxWidgets, is this the preferred option? I also see it's supported by a single person, huge respect, but I'm concerned about the long term viability of the project.
You're too late to be concerned :( . It's not been maintained for some time now, and wxWidgets is moving (slowly) to cmake.

Regards,

David
david_mtl
Earned a small fee
Earned a small fee
Posts: 20
Joined: Fri Jan 10, 2020 4:13 pm

Re: Which build system is best for cross-platform development?

Post by david_mtl »

Ah, good to know about Bakefile, thanks!

I guess it would be worth it to bite the bullet and learn CMake, can't be a bad time investment considering how ubiquitous it is.

Food for thought, thanks!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Which build system is best for cross-platform development?

Post by ONEEYEMAN »

Hi,
Every platform you target has its own IDE which is free.

Windows has MSVC.
*nix has Ajuta for Linux/GTK and Solaris has Solaris Studio. I'm sure other flavors of UNIX has their own product
Mac has Xcode.

Basically what I do is build wx in MSVC/Terminal and then use IDE to create my own software.

I didn't look how to incorporate everything whe there will be no Xcode, but I'm sure it will be easy as it will have just a appropriate Makefile.

So you don't need a CMake/Bakefile/whatever. All you do is to use wizard/MSVC solution to create a project and build it.

Thank you.
david_mtl
Earned a small fee
Earned a small fee
Posts: 20
Joined: Fri Jan 10, 2020 4:13 pm

Re: Which build system is best for cross-platform development?

Post by david_mtl »

ONEEYEMAN wrote: Wed Jan 29, 2020 6:56 pm I didn't look how to incorporate everything whe there will be no Xcode, but I'm sure it will be easy as it will have just a appropriate Makefile.

So you don't need a CMake/Bakefile/whatever. All you do is to use wizard/MSVC solution to create a project and build it.
Just to be sure I understand, do you create a different Makefile for each platform then use their respective IDE (msvc, ajuta, xcode) to compile the project?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Which build system is best for cross-platform development?

Post by ONEEYEMAN »

Hi,
Not really.
Since my project is based on the docview sample I copied the whole folder to some place, opened it inside MSVC, fixed the directory path and recompiled.
Then I pushed everything to the GitHub.
Then I grab the source on Linux. I already had Anjuta installed so I opened the IDE. I created the project based on the wxWidgets wizard and added the sources. Then I selected "Build". At this point Anjuta ran configure and then make as appropriate. Now all I need to do is to make a source changes, fo to <myproject>/Debug/<myproject> and issue "make". If I have a file to add I do it through Anjuta, then do "Build->Clean Target" and then "Build->Build Project".
The same goes to OSX/Xcode. I pull the source created the project in Xcode for C++. Then in Terminal I ran "./wx-config --cxxflags" and "./wx-config --libs". I dropped the results of those commands inside the Xcode project. Then I add the sources in the project and hit "Cmd+B".

All I had to do was to update the Makefile's and add Xcode project folder in GitHub.

Also - it is easier to debug your code with IDE. ;-)

Thank you.
david_mtl
Earned a small fee
Earned a small fee
Posts: 20
Joined: Fri Jan 10, 2020 4:13 pm

Re: Which build system is best for cross-platform development?

Post by david_mtl »

ONEEYEMAN wrote: Wed Jan 29, 2020 9:14 pm Also - it is easier to debug your code with IDE. ;-)
That's a pretty good point. I need an easy way to debug my apps. So I see a few options then.
- Use codelite with different targets for each platform.
- Use a different IDE for each platform.
- Use something like CMake to generate a project for each IDE for each platform.

Looking at CodeLite, they seem to support custom makefiles, that's also interesting, it kinda leaves all doors open. I'll give CodeLite another go, I like the idea of using the same IDE on all platform. Or I'll go hybrid like you did.

Thanks,
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Which build system is best for cross-platform development?

Post by DavidHart »

So I see a few options then.
...
- Use something like CMake to generate a project for each IDE for each platform.
Don't think of it that way. CMake doesn't (afaik) generate projects, the IDE probably does that; certainly CodeLite does.

A project is a way that the IDE organises the code, how it visualises the layout of the files (which doesn't have to be the same as how they are actually stored on the file-system). You write/edit the code, presumably using the editor provided by the IDE which will probably have much better support for C++/wxWidgets (e.g. code-completion) than a standard text editor.

But you also need some way to build the program, which is where CMake (or bakefile or automake or...) comes in. The IDE may provide its own makefiles or whatever, which may be adequate (CodeLite does that; and more recently can also create CMake-based projects, though I've not used one myself and can't speak for its quality). However there should be nothing to stop you choosing a build system for yourself, even if the IDE doesn't have built-in support for it.
I need an easy way to debug my apps.

I can't imagine any current established IDE that doesn't support debugging. That doesn't mean it does it itself, though: one of that platform's debuggers (e.g. gdb, lldb) will do the hard work, but the IDE will supply an interface so you don't need to start the debugger yourself, or remember and type the frequently-used commands: break, backtrace, list...
Post Reply