Skip to content

Commit

Permalink
Move the .private sub dir to Utils
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Sep 8, 2018
1 parent 9f91d88 commit eddef5a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ module Gen (P : Install_rules.Params) = struct
let library_rules (lib : Library.t) ~dir_contents ~dir ~scope
~compile_info ~dir_kind =
let obj_dir = Utils.library_object_directory ~dir lib.name in
let private_obj_dir = Path.relative obj_dir ".private" in
let private_obj_dir = Utils.library_private_obj_dir ~obj_dir in
let requires = Lib.Compile.requires compile_info in
let dep_kind =
if lib.optional then Lib_deps_info.Kind.Optional else Required
Expand Down
2 changes: 1 addition & 1 deletion src/module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ let obj_file t ~obj_dir ~ext =
let base =
match t.visibility with
| Public -> obj_dir
| Private -> Path.relative obj_dir ".private"
| Private -> Utils.library_private_obj_dir ~obj_dir
in
Path.relative base (t.obj_name ^ ext)

Expand Down
3 changes: 3 additions & 0 deletions src/utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ let describe_target fn =
let library_object_directory ~dir name =
Path.relative dir ("." ^ Lib_name.Local.to_string name ^ ".objs")

let library_private_obj_dir ~obj_dir =
Path.relative obj_dir ".private"

(* Use "eobjs" rather than "objs" to avoid a potential conflict with a
library of the same name *)
let executable_object_directory ~dir name =
Expand Down
2 changes: 2 additions & 0 deletions src/utils.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ val library_object_directory
-> Lib_name.Local.t
-> Path.t

val library_private_obj_dir : obj_dir:Path.t -> Path.t

(** Return the directory where the object files for the given
executable should be stored. *)
val executable_object_directory
Expand Down

0 comments on commit eddef5a

Please sign in to comment.