Make file_deps and file_deps_with_exts share code
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
9f43a88950
commit
bde4943692
|
@ -706,23 +706,19 @@ module Libs = struct
|
||||||
(lib_files_alias ~dir ~name:(Library.best_name lib) ~ext))
|
(lib_files_alias ~dir ~name:(Library.best_name lib) ~ext))
|
||||||
|> Path.Set.of_list)
|
|> Path.Set.of_list)
|
||||||
|
|
||||||
|
let file_deps_of_lib t (lib : Lib.t) ~ext =
|
||||||
|
if Lib.is_local lib then
|
||||||
|
Alias.stamp_file
|
||||||
|
(lib_files_alias ~dir:(Lib.src_dir lib) ~name:(Lib.name lib) ~ext)
|
||||||
|
else
|
||||||
|
Build_system.stamp_file_for_files_of t.build_system
|
||||||
|
~dir:(Lib.obj_dir lib) ~ext
|
||||||
|
|
||||||
let file_deps_with_exts t lib_exts =
|
let file_deps_with_exts t lib_exts =
|
||||||
List.rev_map lib_exts ~f:(fun ((lib : Lib.t), ext) ->
|
List.rev_map lib_exts ~f:(fun (lib, ext) -> file_deps_of_lib t lib ~ext)
|
||||||
if Lib.is_local lib then
|
|
||||||
Alias.stamp_file
|
|
||||||
(lib_files_alias ~dir:(Lib.src_dir lib) ~name:(Lib.name lib) ~ext)
|
|
||||||
else
|
|
||||||
Build_system.stamp_file_for_files_of t.build_system
|
|
||||||
~dir:(Lib.obj_dir lib) ~ext)
|
|
||||||
|
|
||||||
let file_deps t libs ~ext =
|
let file_deps t libs ~ext =
|
||||||
List.rev_map libs ~f:(fun (lib : Lib.t) ->
|
List.rev_map libs ~f:(file_deps_of_lib t ~ext)
|
||||||
if Lib.is_local lib then
|
|
||||||
Alias.stamp_file
|
|
||||||
(lib_files_alias ~dir:(Lib.src_dir lib) ~name:(Lib.name lib) ~ext)
|
|
||||||
else
|
|
||||||
Build_system.stamp_file_for_files_of t.build_system
|
|
||||||
~dir:(Lib.obj_dir lib) ~ext)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module Deps = struct
|
module Deps = struct
|
||||||
|
|
Loading…
Reference in New Issue