Building¶
On this page you will learn on how to build the Source.Python binaries
(source-python.so
, source-python.dll
, core.so
and core.dll
) on
your own. This allows you to do tests or contribute to the C++ side of
Source.Python by applying fixes, making improvements or exposing useful stuff
to the Python side.
Linux¶
To build Source.Python on Linux, you need the following requirements:
Once you have installed the requirements, follow these steps to build Source.Python:
- Create a clone of the Source.Python repository.
- Navigate to the
src
directory. - Start the
Build.sh
script. - Choose the game for which you want to build Source.Python.
Note
By default only one CPU core is used to build the binaries. If you wish to
use more, set the variable NUM_CORES
to the number of core you would
like to use. This will speed up the build process, but also requires more
resources.
You can shorten these steps by simply passing the game’s name to the script
e.g. ./Build.sh css
.
If the build finished successfully, it will say something like this:
[100%] Built target core
.
The compiled binaries are stored in src/Builds/Linux/<game>/Release
.
Windows¶
To build Source.Python on Windows, you need the following requirements:
- CMake 2.8 or later
- Git
- Visual C++ 2010
- Microsoft Build Tools (optional, to build directly via Build.bat)
Once you have installed the requirements, follow these steps to build Source.Python:
- Create a clone of the Source.Python repository.
- Navigate to the
src
directory. - Start the
Build.bat
script. - Choose the game for which you want to build Source.Python.
- Go to
src/Builds/Windows/<game>
. - Open
source-python.sln
. - Switch the build mode to
Release
. - Hit
F7
to start the build.
If the build finished successfully, it will say something like that: ``========== Build: 3 succeeded, 0 failed, 0 up-to-date, 1 skipped ========== ``.
You can shorten these steps if you have installed the Microsoft Build Tools.
In that case you can simply start the script and pass the game’s name e.g.
Build.bat css
.
However, in both cases the compiled binaries are stored in src/Builds/Windows/<game>/Release
.