From 675a0cdae0f122ec437cd3cb22b887ff7b1789c4 Mon Sep 17 00:00:00 2001 From: Greta Yorsh Date: Fri, 15 Feb 2019 15:28:46 +0000 Subject: [PATCH] NOT WORKING: cc and cxx variables should depend on c_flags and cxx_flags Signed-off-by: Greta Yorsh --- src/super_context.ml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/super_context.ml b/src/super_context.ml index 612a69247d3..09f0b447569 100644 --- a/src/super_context.ml +++ b/src/super_context.ml @@ -169,7 +169,15 @@ end = struct ~default_context_flags end -let expander = Env.expander +let expander t ~dir= + let strings s = Pform.Var.Values (Value.L.strings s) in + let bindings = + Pform.Map.of_list_exn + [ + "cc" , strings (t.context.c_compiler :: (Env.c_flags t ~dir)) + ; "cxx", strings (t.context.c_compiler :: (Env.cxx_flags t ~dir)) + ] in + Expander.add_bindings (Env.expander t ~dir) ~bindings let add_rule t ?sandbox ?mode ?locks ?loc ~dir build = let build = Build.O.(>>>) build t.chdir in @@ -245,7 +253,7 @@ let partial_expand sctx ~dep_kind ~targets_written_by_user ~map_exe let ocaml_flags t ~dir (x : Buildable.t) = - let expander = Env.expander t ~dir in + let expander = expander t ~dir in Ocaml_flags.make ~flags:x.flags ~ocamlc_flags:x.ocamlc_flags