Open oliora opened 4 years ago
Mp11 does not depend on any other Boost library and can be shipped independently. i.e. Users don't need a Boost distribution, they can clone (or you can package) mp11 from this repository.
@glenfe that’s not exactly what I need for my project. I have a public header dependency on mp11 so if I ship my library binary and headers (so apps can be build against it) I need to either ask user to install boost or ship mp11 along with my headers. Although I agree it’s not a huge issue as it’s only compile time dependency on Boost (or just mp11) for end users of my projects.
I need to either ask user to install boost or ship mp11 along with my headers
There are three options, not two:
i.e. If all of Boost is too much for them, they can get Mp11 alone.
That’s correct. But I’d prefer to use option 1 so users need less to install.
@pdimov What was the rational behind the removal?
I got tired of regenerating the header on every change. :-)
But feel free to use the script and generate your own copy to distribute.
My main motivation for having the single header was to be able to include it on Godbolt, and once mp11 became part of Boost and Godbolt acquired support for libraries, Boost included, this was no longer an issue.
Thank you for the pointer! I guess I can automate it to have latest and greatest single header.
Including individual boost libs as git submodules works great. If you don't like git submodules, CMake can also download individual libraries for you at build time including mp11.
From boost.histograms's CMakeLists.txt:
file(DOWNLOAD
"https://raw.githubusercontent.com/boostorg/cmake/develop/include/BoostFetch.cmake"
"${CMAKE_BINARY_DIR}/fetch_and_include/BoostFetch.cmake"
)
include("${CMAKE_BINARY_DIR}/fetch_and_include/BoostFetch.cmake")
boost_fetch(boostorg/cmake TAG develop NO_ADD_SUBDIR)
FetchContent_GetProperties(boostorg_cmake)
list(APPEND CMAKE_MODULE_PATH ${boostorg_cmake_SOURCE_DIR}/include)
boost_fetch(boostorg/mp11 TAG develop EXCLUDE_FROM_ALL)
There is one very worthwhile option which has not been discussed: drop support for any platform that does not support the latest Boost Libraries.
It would be great to have boost.mp11 available as a single header with root namespace that can be defined from outside. This allows to distribute mp11 along with a library that needs MPL but does not otherwise depend on Boost. Having a definable namespace allows each separate library to distribute its own copy of mp11 without conflicts. For example I’d like to use mp11 in my Ppconsul project without introducing a dependency on modern Boost (one is not available on some platforms where Ppconsul is used). Currently Ppconsul uses Boost.MPL and Boost.Fusion which I want to get rid of in favor of some modern MPL library as formers are slow to compile and harder to use.
Other modern MPL libraries usually have a single header version ( I guess for exact same reason).
If there is a general interest in getting a single header mp11 I can implement it.