Ensure executables depend on object files
Previously, in Mode.Native, executables depended on .cmx files only. This was fine when changes were detected by timestamp, but it is possible to semantically alter an .ml such that only the .o/.obj file alters. In this situation, Jbuilder would rebuild the .cmx file, but not relink the executable. Fixes #237. Signed-off-by: David Allsopp <david.allsopp@metastack.com>
This commit is contained in:
parent
9180f88dc3
commit
77c79ebff8
|
@ -440,8 +440,14 @@ module Gen(P : Params) = struct
|
|||
~mode
|
||||
[String.capitalize_ascii name]))
|
||||
in
|
||||
let objs (_, cm) =
|
||||
if mode = Mode.Byte then
|
||||
[]
|
||||
else
|
||||
List.map ~f:(Path.change_extension ~ext:ctx.ext_obj) cm
|
||||
in
|
||||
SC.add_rule sctx
|
||||
(libs_and_cm
|
||||
((libs_and_cm >>> Build.dyn_paths (Build.arr objs))
|
||||
&&&
|
||||
Build.fanout
|
||||
(Ocaml_flags.get flags mode)
|
||||
|
|
Loading…
Reference in New Issue