blob: b7fcebc04da60bf02d9f86a52d9351e6a41e0b8d [file] [log] [blame]
Ratan Gupta8af2a892021-02-02 05:48:18 -06001project('phosphor-time-manager',
2 'cpp',
3 version: '0.1',
Patrick Williams4f0dfa22023-07-17 10:07:07 -05004 meson_version: '>=1.1.1',
Ratan Gupta8af2a892021-02-02 05:48:18 -06005 default_options: [ 'warning_level=3',
6 'werror=true',
Patrick Williams4f0dfa22023-07-17 10:07:07 -05007 'cpp_std=c++23',
Ratan Gupta8af2a892021-02-02 05:48:18 -06008 '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
Ratan Gupta8af2a892021-02-02 05:48:18 -060022# Get Compiler and default build type
23
24compiler = meson.get_compiler('cpp')
25
26#########################################################################
27
28# Find the dependencies
29
George Liu0fb8ed42022-07-01 16:21:59 +080030sdbusplus_dep = dependency ('sdbusplus')
31phosphor_logging_dep = dependency ('phosphor-logging')
32phosphor_dbus_interfaces_dep = dependency ('phosphor-dbus-interfaces')
33deps = [
34 sdbusplus_dep,
35 phosphor_logging_dep,
36 phosphor_dbus_interfaces_dep,
37]
Ratan Gupta8af2a892021-02-02 05:48:18 -060038
39###########################################################################
40
41# Get the config data and enable options
42
43conf_data = configuration_data()
Ratan Gupta8af2a892021-02-02 05:48:18 -060044conf_data.set('DEFAULT_TIME_MODE', get_option('default_time_mode'))
Lei YU3afad182023-07-18 13:41:30 +080045conf_data.set_quoted('DEFAULT_TIME_SYNC_OBJECT_PATH', get_option('default_time_sync_object_path'))
Ratan Gupta8af2a892021-02-02 05:48:18 -060046
47configure_file(output: 'config.h', configuration: conf_data)
48
49
50############################################################################
51
52# Gather sources for the target binaries
53
54phosphor_time_manager_sources = [
Ratan Gupta8af2a892021-02-02 05:48:18 -060055 'bmc_epoch.cpp',
56 'manager.cpp',
57 'utils.cpp',
58 'settings.cpp',
59 ]
60
61libtimemanager = static_library('libtimemanager',
62 phosphor_time_manager_sources,
63 dependencies : deps)
64############################################################################
65
Ratan Guptaf901e9c2021-02-03 09:04:59 +053066# Install the files into the build directory
67
68systemd = dependency ('systemd')
Pavithra Barithaya667563c2022-08-01 07:25:35 -050069systemd_system_unit_dir = systemd.get_variable(
Patrick Williams4c5143f2023-04-12 08:01:11 -050070 'systemdsystemunitdir',
Pavithra Barithaya667563c2022-08-01 07:25:35 -050071 pkgconfig_define: ['prefix', get_option('prefix')])
Manojkiran Eda83a3bfe2023-07-27 05:30:37 +053072
73filesystem = import('fs')
74filesystem.copyfile('xyz.openbmc_project.Time.Manager.service',
75 install: true,
76 install_dir: systemd_system_unit_dir)
Ratan Guptaf901e9c2021-02-03 09:04:59 +053077
78#############################################################################
79
Ratan Gupta8af2a892021-02-02 05:48:18 -060080# Build binaries
81
82executable('phosphor-time-manager',
83 'main.cpp',
84 link_with : libtimemanager,
85 dependencies : deps,
86 install : true)
87
88if get_option('tests').enabled()
89 subdir('test')
90endif