-
Notifications
You must be signed in to change notification settings - Fork 202
Compilation and installation options
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 ..
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 variable LOGGING_ENABLED
.
# Enable logging
cmake .. -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 the IO_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 about tacopie io_service
, please refer to the dedicated wiki page.
By default, cpp_redis is compiled using the /MT Runtime Library configuration.
You can use the MSVC_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 to Custom Network Module
wiki page for more information about how to use your own TCP client library in place of tacopie
.
By default, select()
timeout is set to NULL (unlimited timeout) in the implementation of the tacopie io_service
, meaning that select will sleep indefinitely until a notification is received.
If this behavior is not desirable, you can configure the select()
timeout at runtime by using the CMake variable SELECT_TIMEOUT
and setting it with a micro-seconds duration.
Of course, this configuration only makes sense if you are using tacopie
as the networking library (or any other libraries supporting the SELECT_TIMEOUT
define).
# Configure select timeout to 1 second
cmake .. -DSELECT_TIMEOUT=1000000L
Need more information? Contact me.