Search code examples
boostclangemscriptenbjam

boost bjam with emscripten


I am having problems trying to compile my project with emscriten and boost's bjam build system. This is my user-config:

using clang
  : 5.4
  : emcc
  : <archiver>emar
    <ranlib>emranlib
  ;

This is how I build my project:

bjam toolset=clang-5.4 -j3 -d+2 --user-config=em.jam release

The problem I experience is, that bjam refuses to use the supplied archiver and ranlib. This causes a segmentation fault:

/bin/sh: line 1: 13572 Segmentation fault      (core dumped) "ar" rc "../.build/

I can't get it to use emar, no matter what I try. Running emar manually works without any problems.


Solution

  • You can now use the "emscripten" toolset included in Boost Build (emscripten.jam). It will handle everything except shared libs.