-
Notifications
You must be signed in to change notification settings - Fork 12
Building SPMod on Linux
Instructions for building SPMod on Linux using Clang and GCC.
- Meson 0.44+
- Ninja
- Git
- Compiler fully supporting C++17
- Clang 5+
- libcxx & libcxxabi
- LLVM linker (optional)
- GCC 7+
- Clang 5+
- Clone SPMod repository
git clone --recursive https://github.com/Amaroq7/SPMod.git
- Create folder inside SPMod repository called build
- (Clang only) Build libcxx & libcxxabi.
-
Copy following files to build folder:
-
/path/to/libcxxabi_build/lib/libc++abi.so.1.0
and rename it tolibc++abi.so.1
, -
/path/to/libcxxabi_build/lib/libc++abi.a
, -
/path/to/libcxx_build/lib/libc++.so.1.0
and rename it tolibc++.so.1
, -
/path/to/libcxx_build/lib/libc++.a
, -
/path/to/libcxx_build/lib/libc++experimental.a
.
-
-
Copy content of following folders into
include/llvm
folder:-
/path/to/libcxx/include/*
, -
/path/to/libcxxabi/include/*
.
-
-
Enter build directory
-
Generate initial build files
meson .. .
-
(Optional) If you wish to build SPMod by linking it dynamically which results in smaller size
meson configure -D linktype=dynamic
-
To change build type (plain, debug, debugoptimized, release, minsize)
default: debug
meson configure -D buildtype=type
e.g.meson configure -D buildtype=release
-
Check configuration
meson configure
-
Build
ninja
-
Enter build directory
-
Generate initial build files
meson .. .
-
Set C++17 and C11 standard
meson configure -Dcpp_std=c++17 -Dc_std=c11
-
(Optional) If you wish to build SPMod by linking it dynamically which results in smaller size
*Warning*libgcc_s.so.1
andlibstdc++.so.6
are bundled with HLDS by default. If you enable this option they should be removed, it'll allow SPMod to be linked against system's ones. If you're not sure if your system has ones which support C++17 it'd better not change this option.
meson configure -D linktype=dynamic
-
To change build type (plain, debug, debugoptimized, release, minsize)
default: debug
meson configure -D buildtype=type
e.g.meson configure -D buildtype=release
-
Check configuration
meson configure
-
Build
ninja
If all the steps above have been completed, compiled binary should be present in /path/to/spmod/build/src
.