File: meson.build

package info (click to toggle)
siril 1.4.0~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,352 kB
  • sloc: ansic: 174,082; cpp: 28,254; python: 7,891; makefile: 974; xml: 777; sh: 271
file content (95 lines) | stat: -rw-r--r-- 2,589 bytes parent folder | download
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
################################################################################
# Meson main file
################################################################################

################################################################################
# Define project

project('kplot', 
  ['c','cpp'],
  version : '0.1.14',
  license : ['ISC'],
  meson_version: '>=0.55.0',
  default_options : [
    'c_std=gnu11',
    'cpp_std=c++11'
    ],
)

################################################################################
# Meson modules and compilers

## Compilers
cc = meson.get_compiler('c')

################################################################################
# Dependencies

## Core dependencies
m_dep = cc.find_library('m', required : false)
cairo_dep = dependency('cairo', required : true)

################################################################################
# Configuration

## General and package configuration
conf_data = configuration_data()

## Test reallocarray
code = '''#include <stdlib.h>
int main(void) { return( ! reallocarray(NULL, 2, 2));}
'''

# TODO: Better crosscompilation support.
rcode = 1
if meson.can_run_host_binaries()
    result = cc.run(code, name : 'reallocarray check')
    rcode = result.returncode()
endif

if rcode == 0
  conf_data.set('HAVE_', true)
else
  conf_data.set('HAVE_', false)
endif

################################################################################
# Generate configuration files

configure_file(input : 'compat.h.in',
               output : 'compat.h',
               configuration : conf_data)

################################################################################
# List sources

inc = include_directories('.')

src_files = ['colours.c',
              'array.c',
              'border.c',
              'bucket.c',
              'buffer.c',
              'draw.c',
              'grid.c',
              'hist.c',
              'label.c',
              'kdata.c',
              'kplot.c',
              'margin.c',
              'mean.c',
              'plotctx.c',
              'reallocarray.c',
              'stddev.c',
              'tic.c',
              'vector.c']

################################################################################
# Build kplot library

kplot_lib = static_library('kplot', src_files, dependencies : [m_dep, cairo_dep], include_directories : inc)

################################################################################
# Dependency kplot

kplot_dep = declare_dependency(include_directories : inc, link_with : kplot_lib)