I'm trying to build boost 1.71 for a platform which doesn't have mmap
/munmap
(Nintendo Switch with devkitPro toolchain). The build fails because there is no <sys/mman.h>
file.
How do I configure boost to disable memory-mapped IO? I have checked boost/config/user.hpp
but there seems to be no relevant options in there.
Make sure
BOOST_CONTEXT_USE_MAP_STACK
is not defined
avoid including context/posix/protected_fixedsize_stack.hpp
. (header guard BOOST_CONTEXT_PROTECTED_FIXEDSIZE_H
)
avoid including coroutine/posix/protected_stack_allocator.hpp
. (header guard BOOST_COROUTINES_PROTECTED_STACK_ALLOCATOR_H
)
BOOST_SPIRIT_FILEITERATOR_POSIX
is not defined if you use Spirit Classic
Don't use Boost Interprocess shared memory/mapped files. interprocess/anonymous_shared_memory.hpp
, interprocess/shared_memory_object.hpp
, interprocess/mapped_region.hpp
)
There seems to potentially be a way to (de)configure some of the for BOost Interprocess but I don't know what sets
defined(BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS)
and it looks like it doesn't cover all uses anyways
The list is going to include all the above and anything that transitively depends on them.
This could be a lot, but I haven't traced them. So maybe you are in luck for the libraries you are after
The following direct dependencies can be tweaked though:
LACKS_SYS_MMAN_H
already so no issue thereiostreams/src/mapped_file.cpp
is a problem, so you can't build the Iostreams library (simply exclude it). If you need the rest, you can follow their guide to include specific source files for specific parts of the library implementation