Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

Compilation and installation options

Simon Ninon edited this page Oct 15, 2016 · 11 revisions

Compilation and installation options

Custom installation directory

By default, the make install command will install the library globally in your system (/usr/lib for example).

You can change that location by using a dedicated cmake option:

cmake -DCMAKE_INSTALL_PREFIX=/destination/path ..

Remove logging from source code

By default, logging is disabled until you set cpp_redis::active_logger.

However, this does not prevent the presence of lines of code intended for logging and trying to output logs (like if (active_logger) { active_logger->info(...); }.

If you wish those lines to be suppressed from the source code (for increasing performance by removing unnecessary checks for example), you can set the CMake variable NO_LOGGING.

# Remove line of codes relates to logging from source code at compile time
cmake .. -DNO_LOGGING=1

Custom socket read size

# Change the read size used to read data from sockets (default value: 4096)
cmake .. -DREAD_SIZE=4096

Building tests

cmake .. -DBUILD_TESTS=true

You will also need to install some dependencies required to build the tests (GoogleTest).

This can be done by executing the install_deps.sh script, located in the root of the repository. This script installs the dependencies locally: no dependency is installed globally in your system.

Building examples

cmake .. -DBUILD_EXAMPLES=true
Clone this wiki locally