Skip to content

Commit 05f3cfc

Browse files
committed
packaging constraints
1 parent 9e36fff commit 05f3cfc

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

example/dune2/dune

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
(include dune.analysis.inc)
99

1010
(rule
11+
(enabled_if %{bin-available:lintcstubs})
1112
(deps
1213
(:mlfiles
1314
(glob_files_rec *.ml))
@@ -20,5 +21,7 @@
2021

2122
(rule
2223
(alias runtest)
24+
(package lintcstubs-rules)
25+
(enabled_if %{bin-available:lintcstubs})
2326
(action
2427
(diff dune.analysis.inc dune.analysis.inc.gen)))

example/dune2/dune.analysis.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
(rule (targets foo2.model.c ./primitives.h)
1+
(rule (enabled_if %{bin-available:lintcstubs_genmain})
2+
(targets foo2.model.c ./primitives.h)
23
(deps (:cmt ./.foo2.objs/byte/foo2.cmt) %{bin:lintcstubs_arity_cmt}
34
%{bin:lintcstubs_genwrap} %{bin:lintcstubs_genmain})
45
(action
@@ -9,7 +10,8 @@
910
(run %{bin:lintcstubs_genmain} %{cmt}))))))
1011
(rule (alias cstubs) (deps (:ofiles foo2.model.o foostubs.o))
1112
(action (echo "for BEAR")))
12-
(rule (targets ./lintcstubs.log ./lintcstubs.sarif)
13+
(rule (enabled_if %{bin-available:lintcstubs})
14+
(targets ./lintcstubs.log ./lintcstubs.sarif)
1315
(deps compile_commands.json (:primitives ./primitives.h)
1416
(:model foo2.model.c) %{bin:lintcstubs} (package lintcstubs))
1517
(action

rules/main.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ let cmt_rule =
2020
Sexplib.Sexp.of_string
2121
{|
2222
(rule
23+
(enabled_if %{bin-available:lintcstubs_genmain})
2324
(targets %{model} %{primitives})
2425
(deps (:cmt) %{bin:lintcstubs_arity_cmt} %{bin:lintcstubs_genwrap} %{bin:lintcstubs_genmain})
2526
(action
@@ -50,6 +51,7 @@ let analyze_rule =
5051
Sexplib.Sexp.of_string
5152
{|
5253
(rule
54+
(enabled_if %{bin-available:lintcstubs})
5355
(targets %{log} %{sarif})
5456
(deps compile_commands.json (:primitives) (:model) %{bin:lintcstubs} (package lintcstubs))
5557
(action

0 commit comments

Comments
 (0)