Building with Code::Blocks

From PioneerWiki
Revision as of 16:52, 23 February 2014 by Luomu (talk | contribs) (Created page with "These are instructions for building Pioneer for '''Windows''' using the '''Code::Blocks''' IDE, with GCC as the compiler. First, acquire C::B: http://www.codeblocks.org/. Ver...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

These are instructions for building Pioneer for Windows using the Code::Blocks IDE, with GCC as the compiler.

First, acquire C::B: http://www.codeblocks.org/. Version 13.12 is verified to work.

Then, you will need a compiler toolchain. Install the 32-bit TDM-GCC bundle from: http://tdm-gcc.tdragon.net/. You may add the bin/ directory to your PATH but that is not necessary.

You may use other distributions (http://sourceforge.net/projects/mingwbuilds/, http://mingw-w64.sourceforge.net/) but then you most likely cannot use the prebuilt dependencies package.

In C::B, open Settings->Compiler..., selected compiler should be GNU GCC compiler. On tab "Toolchain executables" the paths should be:

  • Compiler's install directory: C:\TDM-GCC-32 (or wherever you put it)
  • C compiler: mingw32-gcc.exe
  • C++ compiler: mingw32-g++.exe
  • Linker for dynamic libs: mingw32-g++.exe
  • Linker for static libs: ar.exe
  • Resource compiler: windres.exe
  • Make program: mingw32-make.exe

Also, in Settings->Debugger you can set the path to C:\TDM-GCC-32\bin\gdb.exe for debugging to work.

Premake4 is used to generate the C::B project file. Link here.

Third-party dependencies package.

Open command prompt and go to pioneer/win32/codeblocks. Generate the project file:

premake4.exe --thirdparty=D:/Dev/mingw32 codeblocks

Substitute the correct location for the third-party deps root folder, using forward slashes. Using --thirdparty is optional if you set the correct include and lib paths in C::B settings.

Pioneer.cbp is generated in the build/ subdirectory, open it in C::B and build the pioneer subproject. The executables are placed in the pioneer root directory. Copy the .dlls from the third-party dependencies before running for the first time.

Extra options for the premake script

Known issues

  • Plenty of warnings from contrib header files.
  • Starting the build for the entire workspace does not give the correct build order. Launch the build for the pioneer subproject instead.