Jump to content
  • Advertisement
Sign in to follow this  
jujumbura

Redistributable x86 C++ Compiler for Pipeline

This topic is 1942 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all,

 

I have a build pipeline for a game, which requires that a Win32 console executable be recompiled whenever certain files change.  This executable is not the game itself, but must be up-to-date before the game itself is compiled.  The compiler I am using for the game is not capable of compiling for the x86 platform, so I need to find a different one.

 

Typically I use Visual Studio when compiling Win32 applications, but I am doubtful that the licensing agreement allows me to take that compiler and redistribute it as part of our build pipeline.  Does anybody have any good suggestions regarding a free, redistributable C++ compiler that sounds like it might fit this purpose?

 

Thank you very much for reading!

Share this post


Link to post
Share on other sites
Advertisement

I'd tend to say clang/llvm, as it's generally a nicer compiler chain to work with than MinGW/GCC.

Share this post


Link to post
Share on other sites

Well there's GCC http://gcc.gnu.org/

 

Doesn't sound like a very good distribution strategy, include a compiler. Can't you rewrite the console app in a language that only requires a runtime (python, java, C# say) or make your build pipeline configure itself from some kind of text file?

 

If you tell us what the console app actually does we may be able to suggest better alternatives.

Share this post


Link to post
Share on other sites

I'd tend to say clang/llvm, as it's generally a nicer compiler chain to work with than MinGW/GCC.

 

Oh, i didn't even know clang was available on Windows.

Share this post


Link to post
Share on other sites

Typically I use Visual Studio when compiling Win32 applications, but I am doubtful that the licensing agreement allows me to take that compiler and redistribute it as part of our build pipeline.  Does anybody have any good suggestions regarding a free, redistributable C++ compiler that sounds like it might fit this purpose?

Visual Studio is not free to redistribute, but do you really intend to distribute the entire Windows SDK?

 

You are going to need all the system libraries, header files, and so on.  That means you need the Windows SDK.  You will need it regardless of the compiler you choose.

 

The Windows SDK is free, and it includes the compiler, linker, and other tools.  It just doesn't include Visual Studio.

Edited by frob

Share this post


Link to post
Share on other sites

Hello all,

 

I have a build pipeline for a game, which requires that a Win32 console executable be recompiled whenever certain files change.  This executable is not the game itself, but must be up-to-date before the game itself is compiled.  The compiler I am using for the game is not capable of compiling for the x86 platform, so I need to find a different one.

 

Typically I use Visual Studio when compiling Win32 applications, but I am doubtful that the licensing agreement allows me to take that compiler and redistribute it as part of our build pipeline.  Does anybody have any good suggestions regarding a free, redistributable C++ compiler that sounds like it might fit this purpose?

 

Thank you very much for reading!

 

This all sounds a little suspect really. Stranger things have happened, and I've certainly seen some "unique" build systems, but it kind of sounds like you're approaching whatever problem is driving this solution from the wrong angle.

 

What I'm guessing your problem is, is that you've got some kind of content processing tool that might need to be rebuilt based on whether some kind of definition or data structure has been modified, which is shared between the game and the tool. The tool is a console app, and the game runs on some platform that's not a PC.

 

If that's an accurate guess, what I'd probably do is set up and distribute a Visual Studio solution (plus a make file, or whatever other workflow-specific build control you want to support) that includes the tool as a separate project/solution (which is configured to build with the VS compiler in this case) that's depended upon by the game solution (which is configured to compile with the platform-specific compiler. To share definitions between both executables, I'd probably isolate them in a third project/solution that is depended upon by both the game and the tool. This third solution would be built twice -- once as a library using the VS tool chain (development host), and once as a library using the platform-specific tool chain (development target). That way, the dependencies should be such that things are built in the correct order whenever the definitions change. There might be other changes needed in the tool or game to keep pace, but those are the breaks. From there, you can support different operating systems or tool chains using standard techniques.

 

Now, you'll also need to be mindful that the different compilers might produce representations of these data structures or definitions that are not binary-compatible. Data sizes, padding, alignment and endinaness might all be different, so you'll need to employ standard techniques for cross-platform development to resolve those problems -- using cross-platform types (stdint.h), conditional compilation, etc -- and you will probably want to marshal data in/out of files piecemeal, rather than reading/writing binary representations of the raw structures.

Share this post


Link to post
Share on other sites

What kind of end-users are going to need to rebuild this executable? Would it be unreasonable to simply require them to install eg. Visual Studio Express (on Windows) or gcc (on other operating systems), both of which are freely available?

Share this post


Link to post
Share on other sites

I'd tend to say clang/llvm, as it's generally a nicer compiler chain to work with than MinGW/GCC.

This may be a stupid question, but how do you use it under Windows? Do you copy the headers and CRT from MingW or MingW-w64, or does it have its own?

Share this post


Link to post
Share on other sites

Currently by default it uses headers and CRT from whatever compiler you used to built it from sources.

If you built clang using Visual Studio or WindowsSDK, then it will use link.exe and headers/libs from Visual Studio/Windows SDK.

If you built clang using MinGW, then it will use ld.exe from binutils and headers/libs provided by mingw.

Of course you can override this and use headers and libraries from whatever folder you wish. Overriding link.exe/ld.exe will require manually calling it - you'll use clang to generate object files, and will call ld.exe/link.exe to produce executable).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!