1cflags{
2 '-D WITH_WAYLAND_SHM',
3 '-D WITH_WAYLAND_DRM',
4 '-I $outdir',
5 '-isystem $builddir/pkg/fontconfig/include',
6 '-isystem $builddir/pkg/freetype/include',
7 '-isystem $builddir/pkg/libdrm/include',
8 '-isystem $builddir/pkg/linux-headers/include',
9 '-isystem $builddir/pkg/pixman/include',
10 '-isystem $builddir/pkg/wayland/include',
11}
12
13pkg.hdrs = copy('$outdir/include/wld', '$srcdir', {'drm.h', 'pixman.h', 'wayland.h', 'wld.h'})
14pkg.hdrs.install = true
15
16local srcs = {
17 'buffer.c',
18 'buffered_surface.c',
19 'color.c',
20 'context.c',
21 'drm.c',
22 'dumb.c',
23 'font.c',
24 'renderer.c',
25 'surface.c',
26 'pixman.c',
27 'wayland.c',
28 'wayland-shm.c',
29 'wayland-drm.c',
30 'wayland-drm-protocol.c.o',
31}
32local libs = {
33 'fontconfig/libfontconfig.a.d',
34 'freetype/libfreetype.a.d',
35 'libdrm/libdrm.a',
36 'pixman/libpixman.a',
37 'wayland/libwayland-client.a.d',
38}
39
40if config.video_drivers and config.video_drivers['intel'] then
41 cflags{'-D WITH_DRM_INTEL', '-isystem $basedir/pkg/libdrm/src/intel'}
42 table.insert(srcs, {'intel.c', 'intel/batch.c'})
43 table.insert(libs, 'libdrm/libdrm_intel.a.d')
44end
45if config.video_drivers and config.video_drivers['nouveau'] then
46 cflags{'-D WITH_DRM_NOUVEAU', '-isystem $basedir/pkg/libdrm/src/nouveau'}
47 table.insert(srcs, 'nouveau.c')
48 table.insert(libs, 'libdrm/libdrm_nouveau.a')
49end
50
51waylandproto('protocol/wayland-drm.xml', {
52 client='protocol/wayland-drm-client-protocol.h',
53 server='protocol/wayland-drm-server-protocol.h',
54 code='wayland-drm-protocol.c'
55})
56
57pkg.deps = {
58 '$outdir/protocol/wayland-drm-client-protocol.h',
59 'pkg/fontconfig/headers',
60 'pkg/freetype/headers',
61 'pkg/libdrm/headers',
62 'pkg/linux-headers/headers',
63 'pkg/pixman/headers',
64 'pkg/wayland/headers',
65}
66
67lib('libwld.a', {srcs, expand{'$builddir/pkg/', libs}})
68
69fetch 'git'