aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
blob: 2ad97478d922262650c9b0b8faef115b1a938867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
project('fbida', 'c')

# tweak warnings
add_global_arguments('-Wno-pointer-sign', language : 'c')

# init configuration
config       = configuration_data()
version      = run_command('cat', 'VERSION')
config.set_quoted('VERSION', version.stdout().strip())

# pkg-config deps
freetype_dep = dependency('freetype2')
fontconf_dep = dependency('fontconfig')
pixman_dep   = dependency('pixman-1')
poppler_dep  = dependency('poppler-glib')
drm_dep      = dependency('libdrm')
gbm_dep      = dependency('gbm')
epoxy_dep    = dependency('epoxy')
exif_dep     = dependency('libexif')
png_dep      = dependency('libpng')
tiff_dep     = dependency('libtiff-4')

# other library deps
cc           = meson.get_compiler('c')
jpeg_dep     = cc.find_library('jpeg')
math_dep     = cc.find_library('m', required : false)

# image formats
read_srcs    = [ 'readers.c', 'rd/read-ppm.c', 'rd/read-bmp.c',
                 'rd/read-jpeg.c', 'rd/read-png.c', 'rd/read-tiff.c' ]
write_srcs   = [ 'writers.c', 'wr/write-ppm.c', 'wr/write-ps.c',
                 'wr/write-jpeg.c', 'wr/write-png.c', 'wr/write-tiff.c' ]
image_deps   = [ jpeg_dep, png_dep, tiff_dep ]

# jpeg transformation support (FIXME: detect version)
trans_srcs   = 'jpeg/62/transupp.c'
trans_inc    =  include_directories('jpeg/62')

# write configuration
configure_file(output : 'config.h', configuration : config)
add_global_arguments(['-include', 'config.h'], language : 'c')

########################################################################

# build fbi
fbi_deps     = [ freetype_dep, fontconf_dep,
                 drm_dep, pixman_dep,
                 exif_dep, image_deps,
                 math_dep ]
fbi_srcs     = [ 'fbi.c', 'fb-gui.c', 'desktop.c',
                 'parseconfig.c', 'fbiconfig.c',
                 'vt.c', 'kbd.c', 'fbtools.c', 'drmtools.c',
                 'dither.c', 'filter.c', 'op.c', 'jpegtools.c', 
                 trans_srcs, read_srcs ]

executable('fbi',
           sources             : fbi_srcs,
           dependencies        : fbi_deps,
           include_directories : trans_inc)

# build fbpdf
fbpdf_deps   = [ drm_dep, gbm_dep, epoxy_dep,
                 pixman_dep, poppler_dep ]
fbpdf_srcs   = [ 'fbpdf.c', 'parseconfig.c', 'fbiconfig.c',
                 'vt.c', 'kbd.c', 'fbtools.c', 'drmtools.c', 'drmtools-egl.c' ]

executable('fbpdf',
           sources             : fbpdf_srcs,
           dependencies        : fbpdf_deps)