Skip to main content

2 posts tagged with "boost"

View All Tags

· One min read
Hreniuc Cristian-Alexandru

I've found this. I haven't tried it, but I want to save it just in case.

Contents:

Boost has experimental CMake support. You have to do a bit of dev to get it working but we've had good experiences so far.

set(BOOST_INCLUDE_LIBRARIES system thread) # enabled libraries
set(BOOST_ENABLE_CMAKE ON) # CMake support
FetchContent_Declare(boost GIT_REPOSITORY https://github.com/boostorg/boost.git ...

The above will get you the compiled libs working. For the header library (Boost::boost aka Boost::headers) there doesn't seem to be CMake support as yet so we wrote a few lines of CMake code to iterate through the FetchContent source directory and added all include folders to a new IMPORTED INTERFACE target.

· 2 min read
Hreniuc Cristian-Alexandru

We had an issue in our server, there were some dataraces. After an investigation we've detected that when we were posting inside a strand, we were using the get_inner_executor() method from the strand, and this resulted in posting the handler to the io_context that was used when creating the strand, it wasn't used the strand, which meant no serialization.

An example of code can be found below.