1project('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() 48conf_data.set_quoted('BUSNAME', get_option('busname')) 49conf_data.set_quoted('OBJPATH_BMC', get_option('obj_path_bmc')) 50conf_data.set('DEFAULT_TIME_MODE', get_option('default_time_mode')) 51 52configure_file(output: 'config.h', configuration: conf_data) 53 54 55############################################################################ 56 57# Gather sources for the target binaries 58 59phosphor_time_manager_sources = [ 60 'epoch_base.cpp', 61 'bmc_epoch.cpp', 62 'manager.cpp', 63 'utils.cpp', 64 'settings.cpp', 65 ] 66 67libtimemanager = static_library('libtimemanager', 68 phosphor_time_manager_sources, 69 dependencies : deps) 70############################################################################ 71 72# Build binaries 73 74executable('phosphor-time-manager', 75 'main.cpp', 76 link_with : libtimemanager, 77 dependencies : deps, 78 install : true) 79 80if get_option('tests').enabled() 81 subdir('test') 82endif 83