Building

On this page you will learn on how to build the Source.Python binaries(source-python.so,source-python.dll,core.so andcore.dll) onyour own. This allows you to do tests or contribute to the C++ side ofSource.Python by applying fixes, making improvements or exposing useful stuffto 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:

  1. Create a clone of theSource.Python repository.

  2. Navigate to thesrc directory.

  3. Start theBuild.sh script.

  4. 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 touse more, set the variableNUM_CORES to the number of core you wouldlike to use. This will speed up the build process, but also requires moreresources.

You can shorten these steps by simply passing the game’s name to the scripte.g../Build.shcss.

If the build finished successfully, it will say something like this:[100%]Builttargetcore.

The compiled binaries are stored insrc/Builds/Linux/<game>/Release.

Windows

To build Source.Python on Windows, you need the following requirements:

Once you have installed the requirements, follow these steps to build Source.Python:

  1. Create a clone of theSource.Python repository.

  2. Navigate to thesrc directory.

  3. Start theBuild.bat script.

  4. Choose the game for which you want to build Source.Python.

  5. Go tosrc/Builds/Windows/<game>.

  6. Opensource-python.sln.

  7. Switch the build mode toRelease.

  8. HitF7 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.batcss.

However, in both cases the compiled binaries are stored insrc/Builds/Windows/<game>/Release.