aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: dcae570fa193c1b5dcf0d374ba201b26a97e4236 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
project('smolbote', 'cpp',
    version: 'master',
    default_options: ['cpp_std=c++17', 'strip=true', 'warning_level=3'],
    license: 'GPL3')

# autogenerate qtcreator project files
# add_postconf_script(script_name, arg1, arg2, ...)
# will run the executable given as an argument after all project files have been generated.
# This script will have the environment variables MESON_SOURCE_ROOT and MESON_BUILD_ROOT set.
#meson.add_postconf_script('tools/gen-qtcreator-config.py', '--prefix=../smolbote', '.')

# add -DQT_NO_DEBUG to non-debug builds
if not get_option('debug')
    add_global_arguments('-DQT_NO_DEBUG', language: 'cpp')
endif

# Qt 5
qt5 = import('qt5')
dep_qt5 = dependency('qt5', modules: ['Core', 'Network', 'Widgets', 'WebEngineWidgets', 'Concurrent', 'Test'])

# Boost
dep_boost = dependency('boost', modules: ['program_options'])

# spdlog
dep_spdlog = dependency('spdlog', fallback: ['spdlog', 'spdlog_dep'], version: '>=1.3.1')

# Breakpad
if get_option('Breakpad').enabled()
dep_breakpad = declare_dependency(
    compile_args: '-DBREAKPAD',
    dependencies: [dependency('breakpad-client'),
                   dependency('threads')]
)
else
    dep_breakpad = declare_dependency()
endif

# KDE
if get_option('Plasma').enabled()
dep_plasma = declare_dependency(
    compile_args: '-DPLASMA',
    dependencies: [ dependency('KF5WindowSystem', method: 'cmake'),
                    dependency('KF5Wallet', method: 'cmake')]
)
else
    dep_plasma = declare_dependency()
endif

# Generate config header
include = include_directories('include')

git = find_program('git').path()
pymod = import('python')
python3 = pymod.find_installation('python3')

dep_genheaders = declare_dependency(
    include_directories: include_directories('.'),
    sources: [
    vcs_tag(
        command: [git, 'describe', '--long', '--abbrev=40'],
        #fallback: defaults to meson.project_version(),
        input: 'include/version.h.in',
        output: 'version.h'
    ),
    custom_target('configheader',
        input: ['tools/config.py', 'Kconfig', host_machine.system() + '/.config'],
        output: 'config.h',
        command: [python3, '@INPUT0@', '--kconfig=@INPUT1@', '--dotconfig=@INPUT2@', '--generate=@OUTPUT@'],
        build_by_default: true
    )]
)

interfaces_moc = qt5.preprocess(
    moc_headers: 'include/profileinterface.h',
    dependencies: dep_qt5
)

dep_gtest = dependency('gtest', required: get_option('testing'))

subdir('lib/about')
subdir('lib/addressbar')
subdir('lib/bookmarks')
subdir('lib/configuration')
subdir('lib/downloads')
subdir('lib/urlfilter')
subdir('lib/webprofile')

subdir('3rd-party/SingleApplication')

subdir('src')
subdir('lang')
subdir('doc')

subdir('plugins/ConfigurationEditor')
subdir('plugins/ProfileEditor')