This project uses the Ninja Project Template for SourceMod Plugins.
The following is documentation of build steps required for the repository at the time this project was generated; the source template may be different in the future.
A few things are needed for developing with this environment:
addons/sourcemod/scripting/
directory from the SourceMod package.%PATH%
/ $PATH
; the script provides
--spcomp-dir
. This also allows you to quickly switch between compiler / SourceMod
versions.You only need to install these once, but make sure to skim over the README.md
in case other
projects using this project template require additional software dependencies.
Expand to see instructions for installing dependencies
ninja
.
scoop install ninja
.apt install ninja-build
will get
you the distro's version, which may be a few versions behind current. That should be fine
enough in most cases.scoop install python
.apt install python3
.spcomp
are supported by the build script; you
do not need to install 32-bit compatibility libraries on your build machine.The tl;dr is that you should be able to build any git-based project in this format with the following commands:
git clone --recurse-submodules ${repo}
# cd into repo
python3 configure.py --spcomp-dir ${dir}
ninja
Detailed explanation:
python3 configure.py --spcomp-dir ${dir}
within the project root, where ${dir}
is a
directory containing the SourcePawn compiler (spcomp
) and SourceMod's base include files.
This will create the build.ninja
script.
python3.8
or some other variant of the executable name, depending on
your environment.--spcomp-dir
isn't specified, the script will try to detect the compiler based on an
existing spcomp
executable in your path.build.ninja
to version control; it should always be generated from
configure.py
as it contains paths specific to your filesystem. (It's ignored by default,
but mentioned here for emphasis.)ninja
; this will read the build.ninja
script and build things as necessary. Files
will be generated and copied to build/
, creating any intermediate folders if they don't exist.
Re-run ninja
whenever you make changes to rebuild any files as necessary.
python3 configure.py
yourself; running ninja
will do this
for you if configure.py
itself is modified, and it will pass in the same parameters you
originally used. You may want to re-run it yourself if you change the options.configure.py
will remain in build/
; run ninja -t cleandead
to remove any lingering outputs.build.ninja
and build/
, then start
from step 2.