DarkRadiant - Compilation Guide: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Line 47: Line 47:
After these commands, the '''libboost_filesystem_vc*.lib''' files (both debug and release variants) are in the '''stage/''' directory below your boost folder. You'll need to repeat the above steps and replace '''filesystem''' with the names of the other libraries '''regex''' and '''system'''.
After these commands, the '''libboost_filesystem_vc*.lib''' files (both debug and release variants) are in the '''stage/''' directory below your boost folder. You'll need to repeat the above steps and replace '''filesystem''' with the names of the other libraries '''regex''' and '''system'''.


Note for x64 users: Add the <tt>address-model=64<tt> option to bjam in order to build static libs with the 64-bit compiler.
Note for x64 users: Add the <tt>address-model=64</tt> option to bjam in order to build static libs with the 64-bit compiler.


Now take the *.lib files and copy them into your '''w32deps/boost/lib''' folder in your darkradiant directory and the linking should succeed.
Now take the *.lib files and copy them into your '''w32deps/boost/lib''' folder in your darkradiant directory and the linking should succeed.

Revision as of 16:03, 13 December 2008

Obtain the Sources

The complete codebase plus all win32 dependencies are available at SourceForge. To check out the sources, open up Explorer and create the folder you want to store them.

First, download and install TortoiseSVN. Nothing special here, just install it into any folder of your preference. After installation it probably will ask to reboot your machine, as Tortoise integrates into the Explorer shell. (You can do that later, when all the other components have been installed).

Right-click somewhere in the white space and choose SVN Checkout. A new dialog appears asing you for the repository URL and the checkout folder. You can copy and paste the URL from here into the dialog window and click ok:

https://darkradiant.svn.sourceforge.net/svnroot/darkradiant/trunk/darkradiant/

Dr checkout.jpg

Check out the Dependencies (Win32)

For Windows builds, the dependencies must be checked out along with the sources. To keep the main source repository small, the dependencies are stored in a different folder next to the trunk:

https://darkradiant.svn.sourceforge.net/svnroot/darkradiant/trunk/w32deps/

To check them out in the correct folder, proceed like this: Go to the parent folder of the one you checked out the sources to. Given you checked them out in C:\DarkRadiant, go to the C:\ folder. Right-click somewhere in the white area of the explorer window and choose SVN > Checkout. (Note: it is necessary to right-click a folder which is not under version control, otherwise Tortoise won't provide the "Checkout" option). Make sure that the w32deps/ folder is created under the C:\DarkRadiant folder, like this:

Dr checkout dependencies.jpg

The resulting folder structure should look like this. The w32deps/ folder must be in the same folder as the radiant/ or include/ folder.

C:\
C:\DarkRadiant
C:\DarkRadiant\include\
C:\DarkRadiant\libs\
C:\DarkRadiant\plugins\
C:\DarkRadiant\radiant\
C:\DarkRadiant\w32deps\    <<----- w32deps/ is next to the radiant/ folder

Compiling

Once you've downloaded the sources, the steps for compiling DarkRadiant depend on your toolset/compiler. Choose one of the links below:

How to compile the boost static libraries in Windows

Any VC++ compiler version other than the ones mentioned above will require a recompile of the boost static libraries which DarkRadiant links against. At the time of writing, DarkRadiant is using the following boost libraries:

  • boost.regex
  • boost.filesystem
  • boost.system

To build these static libraries, boost provides the jam tool (bjam.exe), which can be used to build the statics for you. Go get the boost sources from their website (http://www.boost.org) and extract them into a new folder. Then get bjam (can also be downloaded from their website, but you can also build it from scratch), open a console (Win-R ==> "cmd" => Enter) and head to:

cd <YOUR BOOST FOLDER HERE>
cd libs
cd filesystem
cd build
bjam --toolset=msvc link=static release stage
bjam --toolset=msvc link=static debug stage

After these commands, the libboost_filesystem_vc*.lib files (both debug and release variants) are in the stage/ directory below your boost folder. You'll need to repeat the above steps and replace filesystem with the names of the other libraries regex and system.

Note for x64 users: Add the address-model=64 option to bjam in order to build static libs with the 64-bit compiler.

Now take the *.lib files and copy them into your w32deps/boost/lib folder in your darkradiant directory and the linking should succeed.

See also