Skip to content

Commit

Permalink
Compute keep_flags from within for_alias_module
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne Millon <me@emillon.org>
  • Loading branch information
emillon committed Mar 13, 2023
1 parent 5618780 commit 0944281
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/dune_rules/compilation_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ let create ~super_context ~scope ~expander ~obj_dir ~modules ~flags
; loc
}

let for_alias_module t ?(keep_flags = false) alias_module =
let for_alias_module t alias_module =
let keep_flags = Modules.is_stdlib_alias (modules t) alias_module in
let flags =
if keep_flags then t.flags
else
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/compilation_context.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ val create :
-> t Memo.t

(** Return a compilation context suitable for compiling the alias module. *)
val for_alias_module : t -> ?keep_flags:bool -> Module.t -> t
val for_alias_module : t -> Module.t -> t

val super_context : t -> Super_context.t

Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/module_compilation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ let build_all cctx =
if Modules.is_stdlib_alias modules m then
(* XXX it would probably be simpler if the flags were just for this
module in the definition of the stanza *)
Compilation_context.for_alias_module cctx m ~keep_flags:true
Compilation_context.for_alias_module cctx m
else cctx
in
build_module cctx m))
Expand Down

0 comments on commit 0944281

Please sign in to comment.