Build C++ Boost using Zig toolchain


I would you like build boost using Zig toolchain. Should be it possible (I think yes). Someone with experience to solve this problem? Or someone project using it?
Thank you.

1 Like

I think you would have to be more specific.

Do you want to package all of boost as a zig package using the zig build system?

Boost is pretty large and that could be a lot of work. Very few projects use more than a couple libraries. You will probably fine it more useful/managable to package each boost library individually like most linux distros do. Some may already be available. asio for example is packaged as zig library separate from the rest of boost.

Do you want to build boost with it’s existing build system but replace clang or gcc with zig c++?

This should be easy and I would expect it to pretty much just work. This is great way to use zig as a cross-compiler toolchain.

Or something else entirely?



Thanks for boost asio link and response,

I am thinking more “entirely” using zig toolchain, in concrete, for legacy reasons I need: unit_test_framewok, (w)serialization, thread, test_exec_monitor, system, signals, datetime, chrono and the more complex, I think: boost-python, because need compile using python headers.

I am thinking maybe works change “user-config.jam” and type something like:

using clang : zig cc : zig c++ ;

Or use wrappers / zig-cc.cmd, maybe for boost this change works because boost toolset clang is supported. I want to know if someone try this before. I will try.

Other question: I need compile Python with Zig, if I want boost-python with Zig ?

1 Like