Closed APokorny closed 9 months ago
You do need to use LLFIO in the same C++ standard as how it was built. Or use it in header only mode.
Note that you don't need to set CMAKE_CXX_STANDARD
globally in your CMakeLists.txt
(which is generally considered to be a bad practice). You can instead pass it as an option to CPM like so:
# _llfio_CXX_STANDARD := max(20, ${CMAKE_CXX_STANDARD})
if (CMAKE_CXX_STANDARD GREATER 20)
set(_llfio_CXX_STANDARD ${CMAKE_CXX_STANDARD})
else()
set(_llfio_CXX_STANDARD 20)
endif()
CPMAddPackage(
NAME llfio
GITHUB_REPOSITORY ned14/llfio
GIT_TAG 418a2e9
OPTIONS
"CMAKE_CXX_STANDARD ${_llfio_CXX_STANDARD}"
)
Alternatively you can use the span
alias from the llfio namespace to ensure compatibility with C++17 builds.
I tried to use llfio via CPM (which is a fetchcontent wrapper - similar to quickcpplib - downloads during configure step, then runs add_subdirectoy for the download/clone location and builds with the normal build step):
If I then use llfio in the project, llfio will decide to use std::span. For some reason llfio internally did decide to build with span_lite. So all std::span are span_lite::span. This obviously leads to linker errors.
I can force llfio to behave differently by setting the standard globally:
I am unsure if this is actually an issue inside llfio, or just a paper-cut you have to be aware of.