Files
README.md

RS #

C implementation of RS2.

Building #

There are two options for building: build.sh or CMake.

When using build.sh, a rebuild.sh script will be created that can be used to rebuild (or regenerate in configure mode). To change CFLAGS or similar, simply edit rebuild.sh and rerun it.

Cross compilation toolchains can be set up with:

$ . ./setup_toolchain.sh

Once set up, use build.sh or CMake like normal to cross compile.

Examples #

Release Build #

$ mkdir build-rel
$ cd build-rel
$ PARALLEL=$(nproc) CFLAGS=-Os LDFLAGS=-s ../client244/build.sh

Make or Ninja Development Build #

$ mkdir build-dev
$ cd build-dev
$ CONFIGURE=1 \
  CFLAGS="-g -fsanitize=undefined,address -Wall -Wextra -Wconversion -Wundef -Wshadow -Wmissing-prototypes -Wmissing-variable-declarations" \
  LDFLAGS="-fsanitize=undefined,address" ../client244/build.sh
$ make -j $(nproc)
$ ninja

CMake Build and Clangd Setup #

$ cmake -B build-cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
$ cmake --build build-cmake
$ printf "CompileFlags:\n  CompilationDatabase: build-cmake\n" >.clangd

WebAssembly Build #

$ mkdir build-web
$ cd build-web
$ PARALLEL=$(nproc) CC="clang -target wasm32" CFLAGS=-Os LDFLAGS=-s PLATFORM=web ../client244/build.sh