@@ -648,6 +648,7 @@ val add_string_char :
648
648
649
649
val add_ninja_prefix_var :
650
650
t ->
651
+ char ->
651
652
string ->
652
653
unit
653
654
@@ -771,14 +772,14 @@ let add_char_string b c s =
771
772
b.position <- new_position
772
773
773
774
(* equivalent to add_char " "; add_char "$"; add_string s *)
774
- let add_ninja_prefix_var b s =
775
+ let add_ninja_prefix_var b char s =
775
776
let s_len = String.length s in
776
777
let len = s_len + 2 in
777
778
let new_position = b.position + len in
778
779
if new_position > b.length then resize b len;
779
780
let b_buffer = b.buffer in
780
781
let b_position = b.position in
781
- Bytes.unsafe_set b_buffer b_position ' ' ;
782
+ Bytes.unsafe_set b_buffer b_position char ;
782
783
Bytes.unsafe_set b_buffer (b_position + 1) '$' ;
783
784
Ext_bytes.unsafe_blit_string s 0 b_buffer (b_position + 2) s_len;
784
785
b.position <- new_position
@@ -12682,6 +12683,51 @@ let output
12682
12683
write_file fname digest buf
12683
12684
12684
12685
12686
+ end
12687
+ module Bsb_ninja_global_vars
12688
+ = struct
12689
+ #1 "bsb_ninja_global_vars.ml"
12690
+ (* Copyright (C) 2017 Authors of BuckleScript
12691
+ *
12692
+ * This program is free software: you can redistribute it and/or modify
12693
+ * it under the terms of the GNU Lesser General Public License as published by
12694
+ * the Free Software Foundation, either version 3 of the License, or
12695
+ * (at your option) any later version.
12696
+ *
12697
+ * In addition to the permissions granted to you by the LGPL, you may combine
12698
+ * or link a "work that uses the Library" with a publicly distributed version
12699
+ * of this file to produce a combined library or application, then distribute
12700
+ * that combined work under the terms of your choosing, with no requirement
12701
+ * to comply with the obligations normally placed on you by section 4 of the
12702
+ * LGPL version 3 (or the corresponding section of a later version of the LGPL
12703
+ * should you choose to use a later version).
12704
+ *
12705
+ * This program is distributed in the hope that it will be useful,
12706
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12707
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12708
+ * GNU Lesser General Public License for more details.
12709
+ *
12710
+ * You should have received a copy of the GNU Lesser General Public License
12711
+ * along with this program; if not, write to the Free Software
12712
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
12713
+
12714
+
12715
+
12716
+
12717
+
12718
+ (* Invariant: the two string literal has
12719
+ to be "a" and "$a"
12720
+ *)
12721
+
12722
+ (* let src_root_dir = "g_root"
12723
+
12724
+ let lazy_src_root_dir = "$g_root" *)
12725
+ let g_finger = "g_finger"
12726
+
12727
+
12728
+
12729
+
12730
+
12685
12731
end
12686
12732
module Bsb_ninja_rule : sig
12687
12733
#1 "bsb_ninja_rule.mli"
@@ -12907,12 +12953,12 @@ let make_custom_rules
12907
12953
~package_name
12908
12954
~bsc
12909
12955
~warnings
12910
- ~bs_dep
12956
+ ~( bs_dep : string)
12911
12957
~(ppx_files : Bsb_config_types.ppx list)
12912
12958
~bsc_flags
12913
- ~dpkg_incls
12914
- ~lib_incls
12915
- ~dev_incls
12959
+ ~( dpkg_incls : string)
12960
+ ~( lib_incls : string)
12961
+ ~( dev_incls : string)
12916
12962
(custom_rules : command Map_string.t) :
12917
12963
builtin =
12918
12964
(** FIXME: We don't need set [-o ${out}] when building ast
@@ -12954,6 +13000,8 @@ let make_custom_rules
12954
13000
Ext_buffer.add_string buf package_name;
12955
13001
Ext_buffer.add_string buf (Bsb_package_specs.package_flag_of_package_specs package_specs "$in_d")
12956
13002
end;
13003
+ Ext_buffer.add_string buf " -bs-v ";
13004
+ Ext_buffer.add_ninja_prefix_var buf '-' Bsb_ninja_global_vars.g_finger;
12957
13005
Ext_buffer.add_string buf " $i";
12958
13006
begin match postbuild with
12959
13007
| None -> ()
@@ -13143,7 +13191,7 @@ val phony :
13143
13191
out_channel ->
13144
13192
unit
13145
13193
13146
- val output_kv : string -> string -> out_channel -> unit
13194
+ val output_finger : string -> string -> out_channel -> unit
13147
13195
13148
13196
end = struct
13149
13197
#1 "bsb_ninja_targets.ml"
@@ -13201,9 +13249,9 @@ let phony ?(order_only_deps=[]) ~inputs ~output oc =
13201
13249
end;
13202
13250
output_string oc "\n"
13203
13251
13204
- let output_kv key value oc =
13252
+ let output_finger key value oc =
13205
13253
output_string oc key ;
13206
- output_string oc " = ";
13254
+ output_string oc " : = ";
13207
13255
output_string oc value ;
13208
13256
output_string oc "\n"
13209
13257
@@ -13762,9 +13810,15 @@ let output_ninja_and_namespace_map
13762
13810
13763
13811
let oc = open_out_bin (cwd_lib_bs // Literals.build_ninja) in
13764
13812
mark_rescript oc;
13765
- (* Bsb_ninja_targets.output_kv
13766
- Bsb_ninja_global_vars.src_root_dir per_proj_dir
13767
- oc ; *)
13813
+ let finger_file =
13814
+ fun (x : Bsb_config_types.dependency) -> x.package_install_path //".ninja_log"
13815
+ in
13816
+ Bsb_ninja_targets.output_finger
13817
+ Bsb_ninja_global_vars.g_finger
13818
+ (String.concat " "
13819
+ (Ext_list.map_append bs_dependencies
13820
+ (Ext_list.map bs_dev_dependencies finger_file) finger_file))
13821
+ oc ;
13768
13822
output_static_resources static_resources rules.copy_resources oc ;
13769
13823
(** Generate build statement for each file *)
13770
13824
Ext_list.iter bs_file_groups
0 commit comments