File: meson.build

package info (click to toggle)
pspg 5.8.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,368 kB
  • sloc: ansic: 23,412; sh: 101; makefile: 93; sql: 54
file content (76 lines) | stat: -rw-r--r-- 1,641 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
project('pspg', ['c'], version: '5.8.15')

build_args = [
  '-DPROJECT_NAME=' + meson.project_name(),
  '-DPROJECT_VERSION=' + meson.project_version(),
]

cc = meson.get_compiler('c')

panel = cc.find_library('panelw')
curses = dependency('curses')
math = cc.find_library('m')

message(curses.name())

conf = configuration_data()

if curses.name() == 'ncursesw'
  message('detect ncursesw')
  build_args += '-DHAVE_NCURSESW'
endif

build_args += '-DCOMPILE_MENU'

check_headers = [
  ['ncursesw/menu.h', '-DHAVE_NCURSESW_MENU_H'],
  ['ncurses/menu.h', '-DHAVE_NCURSES_MENU_H'],
  ['menu.h', '-DHAVE_MENU_H'],
  ['ncursesw/curses.h', '-DHAVE_NCURSESW_CURSES_H'],
  ['ncursesw.h', '-DHAVE_NCURSESW_H'],
  ['ncurses/curses.h', '-DHAVE_NCURSES_CURSES_H'],
  ['ncurses.h', '-DHAVE_NCURSES_H'],
  ['curses.h', '-DHAVE_CURSES_H'],
  ['ncursesw/panel.h', '-DHAVE_NCURSESW_PANEL_H'],
  ['ncurses/panel.h', '-DHAVE_NCURSES_PANEL_H'],
  ['panel.h', '-DHAVE_PANEL_H']
]

foreach h : check_headers
  if cc.has_header(h.get(0))
    build_args += h.get(1)
  endif
endforeach

sources = [
  'src/args.c',
  'src/bscommands.c',
  'src/commands.c',
  'src/config.c',
  'src/export.c',
  'src/infra.c',
  'src/inputs.c',
  'src/linebuffer.c',
  'src/menu.c',
  'src/pgclient.c',
  'src/pretty-csv.c',
  'src/print.c',
  'src/pspg.c',
  'src/readline.c',
  'src/sort.c',
  'src/st_menu.c',
  'src/st_menu_styles.c',
  'src/string.c',
  'src/table.c',
  'src/theme_loader.c',
  'src/themes.c',
  'src/unicode.c'
]

project_target = executable(
  meson.project_name(),
  sources,
  dependencies: [ curses, panel, math ],
  install : true,
  c_args : build_args
)