How to prepare a codebase for compiling on both Windows and Unix-based systems

Posted by Max on Stack Overflow See other posts from Stack Overflow or by Max
Published on 2011-02-07T15:13:31Z Indexed on 2011/02/07 15:25 UTC
Read the original article Hit count: 206

Filed under:
|
|
|

Hi! I am wondering about different solutions to easily compile my cross-platform application for both windows and unix.

Right now I am using a makefile on Ubuntu, but before my codebase grows larger I'd like to perform the steps necessary to compile it on Windows, and then continue doing so regularly to see that it still works.

I'd preferably not contaminate my SVN codebase repository with multiple "makefile" solutions, such as VC++ solutions and so on, I'd like a more automatic way. I tried using mingw with make for windows, but it seems my secondexpansion awesomeness doesn't work on the Windows version (or something like that). It wouldn't compile, and also complained about _winNT or something like that not being defined.

How should I prepare my codebase for cross-platform easy compiling? Things like buildtools, perhaps autogenerate VS file from makefile, or something similar. Some preprocessor magic in a stdinc file perhaps?

Thanks!

© Stack Overflow or respective owner

Related posts about c++

Related posts about tools