~jscott/pdfpartition

pdfpartition/meson.build -rw-r--r-- 1.3 KiB
6900e933John Scott Use poppler_document_new_from_gfile() instead. 9 months ago
                                                                                
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
# SPDX-FileCopyrightText: 2022 John Scott <jscott@posteo.net>
# SPDX-License-Identifier: GPL-3.0-or-later
# This is free software subject to the GNU General Public License,
# either version three or, at your option, any later version.
project('pdfpartition', 'c', license: 'GPL-3.0-or-later')

cc = meson.get_compiler('c')
if not cc.compiles('''
#define _POSIX_C_SOURCE 200809L
#include <unistd.h>
#if _POSIX_VERSION < _POSIX_C_SOURCE
#error
#endif''')
	warning('A POSIX-conformant system is required')
endif

posix = ['-D_POSIX_C_SOURCE=200809L']
assert(cc.has_function('getopt', args: posix, prefix: '#include <unistd.h>'))

cairo = dependency('cairo-pdf')
if not cc.compiles('''
#include <cairo.h>
#include <cairo-pdf.h>
#if !CAIRO_HAS_PDF_SURFACE
#error
#endif''', dependencies: cairo, name: 'check for Cairo PDF support')
	error('Cairo PDF support is required')
endif

gio = dependency('gio-2.0')
glib = dependency('glib-2.0')
poppler = dependency('poppler-glib')

if not cc.compiles('''
#include <poppler.h>
#if !POPPLER_HAS_CAIRO
#error
#endif''', dependencies: poppler, name: 'check that Poppler has Cairo support')
	error('support for Poppler Cairo output is required')
endif

executable('pdfpartition', 'main.c', install: true, dependencies: [cairo, gio, glib, poppler])