I'm trying to add a Capy/Corosio interface for Boost.Redis. Something like:
add_library(boost_redis_corosio INTERFACE)
target_link_libraries(boost_redis_corosio INTERFACE
Boost::corosio
)
Adding this raw would break the Boost build, because it would unconditionally compile Capy and Corosio, which might not be supported by older compilers. To prevent this, I need to guard the library somehow:
if (SOME_CONDITION)
add_library(boost_redis_corosio INTERFACE)
target_link_libraries(boost_redis_corosio INTERFACE
Boost::corosio
)
endif()
From a conversation with @pdimov in slack, I got the following data points:
- Checking explicitly myself is a bad idea. Patterns invoking
check_cxx_source_compiles or checking CMAKE_CXX_STANDARD are error prone because it's likely that my definition of what Capy needs does not match what Capy think it needs.
- Depending on variables set by Capy's CMake is a bad idea. Capy might not have been added to the Boost superproject when my CMake code is invoked.
- This problem will be faced by any library depending on Capy, including Corosio, Http and Beast2. Forking Boost.Redis into Boost.Redis2 doesn't solve the problem.
Peter proposes having a BOOST_ENABLE_CAPY option in the Boost superproject, akin to the current BOOST_ENABLE_PYTHON or BOOST_ENABLE_MPI.
I've opened this issue to avoid losing this information. This is probably not relevant until Capy gets accepted into Boost.
I'm trying to add a Capy/Corosio interface for Boost.Redis. Something like:
Adding this raw would break the Boost build, because it would unconditionally compile Capy and Corosio, which might not be supported by older compilers. To prevent this, I need to guard the library somehow:
From a conversation with @pdimov in slack, I got the following data points:
check_cxx_source_compilesor checkingCMAKE_CXX_STANDARDare error prone because it's likely that my definition of what Capy needs does not match what Capy think it needs.Peter proposes having a
BOOST_ENABLE_CAPYoption in the Boost superproject, akin to the currentBOOST_ENABLE_PYTHONorBOOST_ENABLE_MPI.I've opened this issue to avoid losing this information. This is probably not relevant until Capy gets accepted into Boost.