Ratan Gupta | 8af2a89 | 2021-02-02 05:48:18 -0600 | [diff] [blame^] | 1 | project('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 | |
| 14 | project_pretty_name = 'phosphor-time-manager' |
| 15 | project_url = 'https://github.com/openbmc/' + project_pretty_name |
| 16 | project_issues_url = project_url + '/issues/new' |
| 17 | |
| 18 | summary('Issue', project_issues_url, section : 'Report Issues') |
| 19 | |
| 20 | ##################################################################### |
| 21 | |
| 22 | # Validate the c++ Standard |
| 23 | |
| 24 | if get_option('cpp_std') != 'c++17' |
| 25 | error('This project requires cpp std to be in c++17 mode') |
| 26 | endif |
| 27 | |
| 28 | ######################################################################### |
| 29 | |
| 30 | # Get Compiler and default build type |
| 31 | |
| 32 | compiler = meson.get_compiler('cpp') |
| 33 | |
| 34 | ######################################################################### |
| 35 | |
| 36 | # Find the dependencies |
| 37 | |
| 38 | sdbusplus = dependency ('sdbusplus') |
| 39 | logging = dependency ('phosphor-logging') |
| 40 | dbus = dependency ('phosphor-dbus-interfaces') |
| 41 | deps = [sdbusplus, logging, dbus] |
| 42 | |
| 43 | ########################################################################### |
| 44 | |
| 45 | # Get the config data and enable options |
| 46 | |
| 47 | conf_data = configuration_data() |
| 48 | conf_data.set_quoted('BUSNAME', get_option('busname')) |
| 49 | conf_data.set_quoted('OBJPATH_BMC', get_option('obj_path_bmc')) |
| 50 | conf_data.set('DEFAULT_TIME_MODE', get_option('default_time_mode')) |
| 51 | |
| 52 | configure_file(output: 'config.h', configuration: conf_data) |
| 53 | |
| 54 | |
| 55 | ############################################################################ |
| 56 | |
| 57 | # Gather sources for the target binaries |
| 58 | |
| 59 | phosphor_time_manager_sources = [ |
| 60 | 'epoch_base.cpp', |
| 61 | 'bmc_epoch.cpp', |
| 62 | 'manager.cpp', |
| 63 | 'utils.cpp', |
| 64 | 'settings.cpp', |
| 65 | ] |
| 66 | |
| 67 | libtimemanager = static_library('libtimemanager', |
| 68 | phosphor_time_manager_sources, |
| 69 | dependencies : deps) |
| 70 | ############################################################################ |
| 71 | |
| 72 | # Build binaries |
| 73 | |
| 74 | executable('phosphor-time-manager', |
| 75 | 'main.cpp', |
| 76 | link_with : libtimemanager, |
| 77 | dependencies : deps, |
| 78 | install : true) |
| 79 | |
| 80 | if get_option('tests').enabled() |
| 81 | subdir('test') |
| 82 | endif |