-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
If you ever once issue a compilation command with -sUSE_BOOST_HEADERS, Boost somehow ends up on the include path of every subsequent compilation. This is unexpected and incorrect, as for example one might want to use a different version of Boost than what is included, leading to incompatibilities or confusing errors.
Reproducing minimal repo at: mmarczell-graphisoft/embug@d846c9e
Reproduction CI run at: https://github.com/mmarczell-graphisoft/embug/actions/runs/23202095356/job/67427039648#step:4:1
Version of emscripten/emsdk:
5.0.3
Failing command line in full:
em++ main.cpp # this fails, correctly
em++ -sUSE_BOOST_HEADERS main.cpp # this succeeds correctly
em++ main.cpp # this succeeds incorrectlyYou can think of -sUSE_BOOST_HEADERS as a shortcut for ./embuilder build boost_headers. Its kind of like -sUSE_ZLIB is a shortcut for ./embuilder build zlib. This will install libz in the right place such that if you prefer you can then switch to -lz for future builds on the local machine. These things install libz.a in the <sysroot>/usr/lib and <sysroot>/usr/include so there are available ambiently for future calls to the compiler. Just like apt-get install zlib-dev on linux.
All I can recommend is that you ensure that your build process either has ./embuilder build boost_headers as part of the setup phase or -sUSE_BOOST_HEADERS in CFLAGS. Either one should do.
I don't think this is some…