diff --git a/CHANGES.md b/CHANGES.md index 24b2b82fbed..ae477c6bcb3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,8 @@ next - Better support for mli/rei only modules (#490) +- Fix support for byte-code only architectures (#510, fixes #330) + 1.0+beta17 (01/02/2018) ----------------------- diff --git a/src/gen_rules.ml b/src/gen_rules.ml index 4cb7f90d72a..68af9deee3d 100644 --- a/src/gen_rules.ml +++ b/src/gen_rules.ml @@ -999,6 +999,7 @@ module Gen(P : Params) = struct in let { Mode.Dict. byte; native } = lib.modes in let if_ cond l = if cond then l else [] in + let native = native && Option.is_some ctx.ocamlopt in let files = let modules = module_names_of_lib lib ~dir in List.concat @@ -1015,19 +1016,15 @@ module Gen(P : Params) = struct ; if_ byte [ lib_archive ~dir lib ~ext:".cma" ] ; if_ (Library.has_stubs lib) [ stubs_archive ~dir lib ] ; if_ native - (match ctx.ocamlopt with - | None -> [] - | Some _ -> - let files = - [ lib_archive ~dir lib ~ext:".cmxa" - ; lib_archive ~dir lib ~ext:ctx.ext_lib - ] - in - if ctx.natdynlink_supported && lib.dynlink then - files @ [ lib_archive ~dir lib ~ext:".cmxs" ] - else - files - ) + (let files = + [ lib_archive ~dir lib ~ext:".cmxa" + ; lib_archive ~dir lib ~ext:ctx.ext_lib + ] + in + if ctx.natdynlink_supported && lib.dynlink then + files @ [ lib_archive ~dir lib ~ext:".cmxs" ] + else + files) ; List.map lib.buildable.js_of_ocaml.javascript_files ~f:(Path.relative dir) ; List.map lib.install_c_headers ~f:(fun fn -> Path.relative dir (fn ^ ".h")) diff --git a/test/blackbox-tests/test-cases/byte-code-only/run.t b/test/blackbox-tests/test-cases/byte-code-only/run.t index cf2e41c05d4..a38cb0890c4 100644 --- a/test/blackbox-tests/test-cases/byte-code-only/run.t +++ b/test/blackbox-tests/test-cases/byte-code-only/run.t @@ -1,9 +1,7 @@ $ env ORIG_PATH="$PATH" PATH="$PWD/ocaml-bin:$PATH" $JBUILDER build --root . -j1 --display short - No rule found for src/.foo.objs/foo.cmx ocamldep bin/toto.ml.d ocamldep src/foo.ml.d ocamlc bin/.toto.eobjs/toto.{cmi,cmo,cmt} ocamlc src/.foo.objs/foo.{cmi,cmo,cmt} ocamlc bin/toto.exe ocamlc src/foo.cma - [1]