Skip to content

Commit

Permalink
-I include dirs when linking cmxs too
Browse files Browse the repository at this point in the history
  • Loading branch information
pqwy committed Nov 23, 2016
1 parent 7ab52ef commit a6b3b8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/ocb_stubblr.ml
Expand Up @@ -82,8 +82,10 @@ type ocb_hook = Ocamlbuild_plugin.hook -> unit
let after_rules f = function After_rules -> f () | _ -> ()

let include_include_dirs = after_rules @@ fun () ->
flag ["ocaml"; "link"; "program"] @@ S
List.(map (fun dir -> [A "-I"; A dir]) !Options.include_dirs |> concat)
let inc = S List.(!Options.include_dirs
|> map (fun dir -> [A "-I"; A dir]) |> concat) in
flag ["ocaml"; "link"; "program"] inc;
flag ["ocaml"; "link"; "extension:cmxs"] inc

let ocaml_libs ?(mllibs = ["."]) =
after_rules @@ fun () ->
Expand Down
4 changes: 2 additions & 2 deletions src/ocb_stubblr.mli
Expand Up @@ -145,8 +145,8 @@ val ocaml_libs : ?mllibs:path list -> ocb_hook
searched recursively. [mllibs] defaults to [["."]]. *)

val include_include_dirs : ocb_hook
(** [include_include_dirs] will add [-I dir] when linking OCaml programs for
every [dir] marked as [include]. *)
(** [include_include_dirs] will add [-I dir] when linking OCaml programs and
[cmxs] for every [dir] marked as [include]. *)

val ccopt : ?tags:string list -> string -> ocb_hook
(** [ccopt tags options] adds [-ccopt options] when compiling the C sources
Expand Down

0 comments on commit a6b3b8a

Please sign in to comment.