Page 1 of 1

Which build system is best for cross-platform development?

Posted: Wed Jan 29, 2020 5:48 pm
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,

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

Posted: Wed Jan 29, 2020 6:28 pm
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

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

Posted: Wed Jan 29, 2020 6:38 pm
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!

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

Posted: Wed Jan 29, 2020 6:56 pm
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.

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

Posted: Wed Jan 29, 2020 7:23 pm
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?

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

Posted: Wed Jan 29, 2020 9:14 pm
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.

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

Posted: Thu Jan 30, 2020 1:17 am
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,

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

Posted: Thu Jan 30, 2020 8:07 am
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...