Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Compilation and installation options

Yun Wu edited this pageAug 26, 2020 ·2 revisions

Custom installation directory

By default, themake 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 ..

Enable logging

By default, all lines of code related to logging are suppressed at the preprocessing step.

This is done to provide higher performance by avoiding the execution of unnecessary lines of code related to logging even though no logger has been configured.

If you wish to enable logging, you have to disable that default behavior by setting the CMake variableLOGGING_ENABLED.

# Enable loggingcmake .. -DLOGGING_ENABLED=1

Custom socket read size

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

Custom number of io_service workers

The io_service is multithreaded: multiple workers are in charged of IO operations and call the underlying read and write callbacks.

You can configure the number of workers assigned to the io_service by setting theIO_SERVICE_NB_WORKERS CMake variable.

# Change the default number of io_service workers (default value: 1)cmake .. -DIO_SERVICE_NB_WORKERS=1

To learn more abouttacopie io_service, please refer tothe dedicated wiki page.

Windows Runtime Library configuration

By default, cpp_redis is compiled using the /MT Runtime Library configuration.

You can use theMSVC_RUNTIME_LIBRARY_CONFIG Cmake variable to override this setting and choose the Runtime Library of your choice (/MT, /MD, ...).

cmake .. -DMSVC_RUNTIME_LIBRARY_CONFIG=/MD

Building tests

cmake .. -DBUILD_TESTS=true

Building examples

cmake .. -DBUILD_EXAMPLES=true

Use your custom TCP client instead of tacopie

cmake .. -DUSE_CUSTOM_TCP_CLIENT=true

Please refer toCustom Network Modulewiki page for more information about how to use your own TCP client library in place oftacopie.

Configure tacopie select timeout

By default,select() timeout is set to NULL (unlimited timeout) in the implementation of thetacopie io_service, meaning that select will sleep indefinitely until a notification is received.

If this behavior is not desirable, you can configure theselect() timeout at runtime by using the CMake variableSELECT_TIMEOUT and setting it with amicro-seconds duration.

Of course, this configuration only makes sense if you are usingtacopie as the networking library (or any other libraries supporting theSELECT_TIMEOUT define).

# Configure select timeout to 1 secondcmake .. -DSELECT_TIMEOUT=1000000L

Need more information?Contact me.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp