blob: 528b1d514ba9bdaee50693f5fc3788f70836ec16 [file] [log] [blame]
Ratan Gupta8af2a892021-02-02 05:48:18 -06001project('phosphor-time-manager',
2 'cpp',
3 version: '0.1',
4 meson_version: '>=0.53.2',
5 default_options: [ 'warning_level=3',
6 'werror=true',
7 'cpp_std=c++17',
8 'buildtype=debugoptimized' ])
9
10########################################################################
11
12# Project Links
13
14project_pretty_name = 'phosphor-time-manager'
15project_url = 'https://github.com/openbmc/' + project_pretty_name
16project_issues_url = project_url + '/issues/new'
17
18summary('Issue', project_issues_url, section : 'Report Issues')
19
20#####################################################################
21
22# Validate the c++ Standard
23
24if get_option('cpp_std') != 'c++17'
25 error('This project requires cpp std to be in c++17 mode')
26endif
27
28#########################################################################
29
30# Get Compiler and default build type
31
32compiler = meson.get_compiler('cpp')
33
34#########################################################################
35
36# Find the dependencies
37
38sdbusplus = dependency ('sdbusplus')
39logging = dependency ('phosphor-logging')
40dbus = dependency ('phosphor-dbus-interfaces')
41deps = [sdbusplus, logging, dbus]
42
43###########################################################################
44
45# Get the config data and enable options
46
47conf_data = configuration_data()
Ratan Gupta8af2a892021-02-02 05:48:18 -060048conf_data.set('DEFAULT_TIME_MODE', get_option('default_time_mode'))
49
50configure_file(output: 'config.h', configuration: conf_data)
51
52
53############################################################################
54
55# Gather sources for the target binaries
56
57phosphor_time_manager_sources = [
58 'epoch_base.cpp',
59 'bmc_epoch.cpp',
60 'manager.cpp',
61 'utils.cpp',
62 'settings.cpp',
63 ]
64
65libtimemanager = static_library('libtimemanager',
66 phosphor_time_manager_sources,
67 dependencies : deps)
68############################################################################
69
Ratan Guptaf901e9c2021-02-03 09:04:59 +053070# Install the files into the build directory
71
72systemd = dependency ('systemd')
73systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir',
74 define_variable: ['prefix',
75 get_option('prefix')
76 ])
77configure_file(input : 'xyz.openbmc_project.Time.Manager.service',
78 output : 'xyz.openbmc_project.Time.Manager.service',
79 copy : true,
80 install_dir : systemd_system_unit_dir)
81
82#############################################################################
83
Ratan Gupta8af2a892021-02-02 05:48:18 -060084# Build binaries
85
86executable('phosphor-time-manager',
87 'main.cpp',
88 link_with : libtimemanager,
89 dependencies : deps,
90 install : true)
91
92if get_option('tests').enabled()
93 subdir('test')
94endif