Skip to content

Commit 9cf0016

Browse files
committed
Properly declare dependencies for examples/ and add their build as a test target
1 parent 0f55393 commit 9cf0016

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ EXAMPLES := $(patsubst %,examples/%.exe,$(EXAMPLES))
44
default:
55
dune build @install
66

7-
examples: $(EXAMPLES)
8-
9-
$(EXAMPLES):
10-
dune build $@
7+
examples:
8+
dune build @examples
119

1210
clean:
1311
rm -rf _build

examples/dune

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
(executables
2-
(names simple)
3-
(libraries wlroots tgls.tgl3 mtime.clock.os xkbcommon))
2+
(names simple)
3+
(libraries wlroots tgls.tgl3 mtime.clock.os xkbcommon))
4+
5+
(alias
6+
(name examples)
7+
(deps simple.exe))

lib/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
(:include ../config/wayland-server-cclib.sexp)
2828
(:include ../config/pixman-1-cclib.sexp))
2929
(libraries wlroots_types_f wlroots_ffi_f wlroots_common ctypes.stubs ctypes
30-
unix-time.unix mtime.clock.os))
30+
unix-time.unix mtime.clock.os xkbcommon))

wlroots.opam

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ homepage: "https://github.com/swaywm/wlroots-ocaml"
55
bug-reports: "https://github.com/swaywm/wlroots-ocaml/issues"
66
depends: [
77
"ocaml" {>= "4.04.1"}
8+
"xkbcommon"
89
"ctypes"
910
"ctypes-foreign"
1011
"dune"
1112
"unix-time"
1213
"mtime"
13-
"base"
14-
"stdio"
14+
"base" { build }
15+
"stdio" { build }
16+
"tgls" { with-test }
17+
]
18+
build: [
19+
["dune" "build" "-p" name "-j" jobs "@install"]
20+
["dune" "build" "-p" name "-j" jobs "@examples"] { with-test }
1521
]
16-
build: ["dune" "build" "-p" name "-j" jobs "@install"]

0 commit comments

Comments
 (0)