- Notifications
You must be signed in to change notification settings - Fork209
Compilation and installation options
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 ..
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
# Change the read size used to read data from sockets (default value: 4096)cmake .. -DREAD_SIZE=4096
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.
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
cmake .. -DBUILD_TESTS=true
cmake .. -DBUILD_EXAMPLES=true
cmake .. -DUSE_CUSTOM_TCP_CLIENT=true
Please refer toCustom Network Module
wiki page for more information about how to use your own TCP client library in place oftacopie
.
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.