summaryrefslogtreecommitdiff
path: root/scm/meson.build
blob: d0ce3910182fff8394f7012d46efe05b082c4e2b (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
70
71
72
73
74
## Copyright (C) 2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
mu_scm_dir=join_paths(datadir, 'mu', 'scm')
mu_scm_dir_arg='-DMU_SCM_DIR="' + mu_scm_dir + '"'

lib_mu_scm=static_library(
  'mu-scm',  [
    'mu-scm.cc',
    'mu-scm-message.cc',
    'mu-scm-mime.cc',
    'mu-scm-store.cc'
  ],
  dependencies: [
    guile_dep,
    config_h_dep,
    lib_mu_dep,
    lib_mu_utils_dep,
    lib_mu_message_dep],
  install: false,
  cpp_args: [mu_scm_dir_arg])

install_data(['mu-scm.scm',
              'mu-scm-repl.scm'],
             install_dir : mu_scm_dir)

# note: top-level meson.build defines a dummy replacement for this.
mu_scm_dep = declare_dependency(
  link_with: lib_mu_scm,
  dependencies: [guile_dep, lib_mu_dep, config_h_dep, thread_dep ],
  include_directories:
    include_directories(['.', '..']))

if makeinfo.found()
  custom_target('mu_scm_info',
                input: 'mu-scm.texi',
                output: 'mu-scm.info',
                install: true,
                install_dir: infodir,
                command: [makeinfo,
                          '-o', join_paths(meson.current_build_dir(), 'mu-scm.info'),
                          join_paths(meson.current_source_dir(), 'mu-scm.texi'),
                          '-I', join_paths(meson.current_build_dir(), '..')])
  if install_info.found()
    infodir = join_paths(get_option('prefix') / get_option('infodir'))
    meson.add_install_script(install_info_script, infodir, 'mu-scm.info')
  endif
endif

if not get_option('tests').disabled()

  srcdir=meson.current_source_dir()
  def_srcdir='-DMU_SCM_SRCDIR="' + srcdir + '"'

  test('test-scm',
       executable('test-scm',
                  'mu-scm.cc',
                  install: false,
                  build_by_default: false,
                  dependencies: [mu_scm_dep],
                  cpp_args: [mu_scm_dir_arg, def_srcdir, '-DBUILD_TESTS']))
endif