Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #330 #510

Merged
2 commits merged into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-----------------------

Expand Down
23 changes: 10 additions & 13 deletions src/gen_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"))
Expand Down
2 changes: 0 additions & 2 deletions test/blackbox-tests/test-cases/byte-code-only/run.t
Original file line number Diff line number Diff line change
@@ -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]