Skip to content

Commit

Permalink
do not force libs to early
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo Heuzard <[email protected]>
  • Loading branch information
Hugo Heuzard committed Nov 4, 2021
1 parent e78a438 commit 174c75e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/dune_rules/jsoo_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ let link_rule cc ~runtime ~target cm ~flags ~link_time_code_gen =
let ctx = Compilation_context.context cc in
let dir = Compilation_context.dir cc in
let requires = Compilation_context.requires_link cc in
let* special_units =
let+ pre = link_time_code_gen in
List.concat_map pre ~f:(function
| `Mod path -> [ Path.extend_basename ~suffix:".js" path ]
| `Lib _ -> [])
let special_units =
Action_builder.memo_build
(let+ pre = link_time_code_gen in
List.concat_map pre ~f:(function
| `Mod path -> [ Path.extend_basename ~suffix:".js" path ]
| `Lib _ -> []))
in
let get_all =
Action_builder.map cm ~f:(fun cm ->
Action_builder.map (Action_builder.both cm special_units)
~f:(fun (cm, special_units) ->
Resolve.Build.args
(let open Resolve.Build.O in
let+ libs = requires in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@

(rule (with-stdout-to main.ml (echo "")))

(executable (name main) (libraries baz))
(executable (name main) (modes native js) (libraries baz))

0 comments on commit 174c75e

Please sign in to comment.