aboutsummaryrefslogtreecommitdiff
path: root/src/timezone/meson.build
blob: 16f082ecfa8d782c82eb5d6091e6829b0343d909 (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
# files to build into backend
timezone_sources = files(
  'localtime.c',
  'pgtz.c',
  'strftime.c',
)


timezone_inc = include_directories('.')

timezone_localtime_source = files('localtime.c')

# files needed to build zic utility program
zic_sources = files(
   'zic.c'
)

# we now distribute the timezone data as a single file
tzdata = files(
  'data/tzdata.zi'
)


if get_option('system_tzdata') == ''
  # FIXME: For cross builds, it would need a native built libpgport/pgcommon to
  # build our zic. But for that we'd need to run a good chunk of the configure
  # tests both natively and cross. Unclear if it's worth it.
  if meson.is_cross_build()
    zic = find_program(get_option('ZIC'), native: true, required: true)
  else
    zic = executable('zic', zic_sources,
                     dependencies: [frontend_code],
                     kwargs: default_bin_args + {'install': false}
                    )
  endif

  tzdata = custom_target('tzdata',
    input: tzdata,
    output: ['timezone'],
    command: [zic, '-d', '@OUTPUT@', '@INPUT@'],
    install: true,
    install_dir: dir_data,
  )

  bin_targets += tzdata
endif

subdir('tznames')