From a425e0ad949dc50319e0c328a4b1d5cdcb37f535 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 31 Jul 2018 13:44:59 +0200 Subject: [PATCH] Define alias as empty if it's disabled this is so that others can still depend on it Signed-off-by: Rudi Grinberg --- src/simple_rules.ml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/simple_rules.ml b/src/simple_rules.ml index 6f7107d4..2cc62a51 100644 --- a/src/simple_rules.ml +++ b/src/simple_rules.ml @@ -82,16 +82,16 @@ let alias sctx ~dir ~scope (alias_conf : Alias_conf.t) = } in Blang.eval_bool blang ~dir ~f in + let stamp = + let module S = Sexp.To_sexp in + Sexp.List + [ Sexp.unsafe_atom_of_string "user-alias" + ; Jbuild.Bindings.sexp_of_t Jbuild.Dep_conf.sexp_of_t alias_conf.deps + ; S.option Action.Unexpanded.sexp_of_t + (Option.map alias_conf.action ~f:snd) + ] + in if enabled then - let stamp = - let module S = Sexp.To_sexp in - Sexp.List - [ Sexp.unsafe_atom_of_string "user-alias" - ; Jbuild.Bindings.sexp_of_t Jbuild.Dep_conf.sexp_of_t alias_conf.deps - ; S.option Action.Unexpanded.sexp_of_t - (Option.map alias_conf.action ~f:snd) - ] - in add_alias sctx ~dir ~name:alias_conf.name @@ -112,3 +112,9 @@ let alias sctx ~dir ~scope (alias_conf : Alias_conf.t) = ~targets:Alias ~targets_dir:dir ~scope) + else + add_alias sctx + ~dir + ~name:alias_conf.name + ~stamp + (Build.return (Action.Progn []))