Skip to content

Latest commit

 

History

History

sip

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sip

Sip is a tool for preparing and managing Sim problem packages

How to build

You will need meson build system to be installed (on most platforms it is in the meson package).

Dependencies

You need a C++ compiler with C++17 support. Meson will point out missing dependencies.

Here are instructions how to satisfy dependencies on some systems:

Debian / Ubuntu

sudo apt-get install meson g++ libseccomp-dev libzip-dev libcap-dev

Arch Linux

sudo pacman -S meson gcc libseccomp libzip libcap

Tutorial: release build step by step

First of all clone the repository and all its submodules:

git clone https://github.com/varqox/sim-project && cd sim-project/subprojects/sip/

Then setup build directory:

meson setup release-build/ -Dbuildtype=release --prefix=/usr

And build:

ninja -C release-build/ base

The above command creates a dynamic executable release-build/sip.

Finally, check if everything is working by running tests:

ninja -C release-build/ test

Installing is done via:

sudo meson install -C release-build

Now you can use sip command:

sip

For more information about how to use it and what it can do type:

sip help

Upgrading

Just type:

git pull --rebase --autostash
git submodule update --init --recursive
meson -C release-build base
sudo meson install -C release-build

Release build

meson setup release-build/ -Dbuildtype=release -Ddefault_library=both
ninja -C release-build/ base

Development build

meson setup build/ -Dc_args=-DDEBUG -Dcpp_args='-DDEBUG -D_GLIBCXX_DEBUG' -Db_sanitize=undefined -Db_lundef=false
ninja -C build/ base

Static build

Static build is useful if you want to build executables linked statically.

meson setup static-build/ -Ddefault_library=static -Dstatic=true
ninja -C static-build/ base

Installing

Run after building:

# we will use release-build build directory, if you use other just change all release-build below
meson configure release-build --prefix=/usr
sudo meson install -C release-build/

Running tests

ninja -C build/ test # or other build directory

Development build targets

Formating C/C++ sources

To format all sources (clang-format is required):

ninja -C build format

Linting C/C++ sources

All sources

To lint all sources:

ninja -C build tidy

or

./tidy

Specified sources

To lint specified sources:

./tidy path/to/source.cc other/source.h

Static analysis

ninja -C build scan-build