-
Notifications
You must be signed in to change notification settings - Fork 10
/
meson.build
90 lines (64 loc) · 2.78 KB
/
meson.build
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
project('phosphor-time-manager',
'cpp',
version: '0.1',
meson_version: '>=1.1.1',
default_options: [ 'warning_level=3',
'werror=true',
'cpp_std=c++23',
'buildtype=debugoptimized' ])
########################################################################
# Project Links
project_pretty_name = 'phosphor-time-manager'
project_url = 'https://github.com/openbmc/' + project_pretty_name
project_issues_url = project_url + '/issues/new'
summary('Issue', project_issues_url, section : 'Report Issues')
#####################################################################
# Get Compiler and default build type
compiler = meson.get_compiler('cpp')
#########################################################################
# Find the dependencies
sdbusplus_dep = dependency ('sdbusplus')
phosphor_logging_dep = dependency ('phosphor-logging')
phosphor_dbus_interfaces_dep = dependency ('phosphor-dbus-interfaces')
deps = [
sdbusplus_dep,
phosphor_logging_dep,
phosphor_dbus_interfaces_dep,
]
###########################################################################
# Get the config data and enable options
conf_data = configuration_data()
conf_data.set('DEFAULT_TIME_MODE', get_option('default_time_mode'))
conf_data.set_quoted('DEFAULT_TIME_SYNC_OBJECT_PATH', get_option('default_time_sync_object_path'))
configure_file(output: 'config.h', configuration: conf_data)
############################################################################
# Gather sources for the target binaries
phosphor_time_manager_sources = [
'bmc_epoch.cpp',
'manager.cpp',
'utils.cpp',
'settings.cpp',
]
libtimemanager = static_library('libtimemanager',
phosphor_time_manager_sources,
dependencies : deps)
############################################################################
# Install the files into the build directory
systemd = dependency ('systemd')
systemd_system_unit_dir = systemd.get_variable(
'systemdsystemunitdir',
pkgconfig_define: ['prefix', get_option('prefix')])
filesystem = import('fs')
filesystem.copyfile('xyz.openbmc_project.Time.Manager.service',
install: true,
install_dir: systemd_system_unit_dir)
#############################################################################
# Build binaries
executable('phosphor-time-manager',
'main.cpp',
link_with : libtimemanager,
dependencies : deps,
install : true)
if get_option('tests').allowed()
subdir('test')
endif