ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.64k stars 410 forks source link

Js_of_ocaml rules: fix whole program compilation #11124

Closed vouillon closed 6 days ago

vouillon commented 1 week ago

We need to take into account the executable stanza to see whether we need to build a .bc-for-jsoo file.

hhugo commented 1 week ago

Looks good. Maybe add a test for inline_tests as well

vouillon commented 1 week ago

The compilation_mode option is only in executables stanzas, while inline tests are only for libraries. So this PR does not actually make any change for inline tests. And we already test whole program compilation for inline tests: https://github.com/ocaml/dune/blob/967f566c36425560b2327b25e5e69f4f48a790a5/test/blackbox-tests/test-cases/jsoo/inline-tests.t/run.t#L18