1project('pldm', ['c', 'cpp'], 2 version: '0.1', meson_version: '>=0.53.2', 3 default_options: [ 4 'warning_level=3', 5 'default_library=shared', 6 'werror=true', 7 'cpp_std=c++17', 8 'buildtype=debugoptimized' 9 ]) 10 11# Wno-psabi reduces the number of "Note:" messages when cross-compiling some STL 12# stuff for ARM. See https://stackoverflow.com/questions/48149323/strange-gcc-warning-when-compiling-qt-project 13# Basically, gcc 6 and gcc 7 are not ABI compatible, but since the whole OpenBMC 14# project uses the same compiler, we can safely ignmore these info notes. 15add_project_arguments('-Wno-psabi', language: 'cpp') 16 17 18# Disable FORTIFY_SOURCE when compiling with no optimization 19if(get_option('optimization') == '0') 20 add_project_arguments('-U_FORTIFY_SOURCE',language:['cpp','c']) 21 message('Disabling FORTIFY_SOURCE as optimization is set to 0') 22endif 23 24conf_data = configuration_data() 25conf_data.set_quoted('BIOS_JSONS_DIR', '/usr/share/pldm/bios') 26conf_data.set_quoted('BIOS_TABLES_DIR', '/var/lib/pldm/bios') 27conf_data.set_quoted('PDR_JSONS_DIR', '/usr/share/pldm/pdr') 28conf_data.set_quoted('FRU_JSONS_DIR', '/usr/share/pldm/fru') 29conf_data.set_quoted('HOST_JSONS_DIR', '/usr/share/pldm/host') 30conf_data.set_quoted('EVENTS_JSONS_DIR', '/usr/share/pldm/events') 31if get_option('softoff').enabled() 32 conf_data.set('SOFTOFF_TIMEOUT_SECONDS', get_option('softoff-timeout-seconds')) 33endif 34if get_option('oem-ibm').enabled() 35 conf_data.set_quoted('FILE_TABLE_JSON', '/usr/share/pldm/fileTable.json') 36 conf_data.set_quoted('LID_RUNNING_DIR', '/var/lib/phosphor-software-manager/hostfw/running') 37 conf_data.set_quoted('LID_ALTERNATE_DIR', '/var/lib/phosphor-software-manager/hostfw/alternate') 38 conf_data.set_quoted('LID_STAGING_DIR', '/var/lib/phosphor-software-manager/hostfw/staging') 39 conf_data.set_quoted('LID_RUNNING_PATCH_DIR', '/usr/local/share/hostfw/running') 40 conf_data.set_quoted('LID_ALTERNATE_PATCH_DIR', '/usr/local/share/hostfw/alternate') 41 conf_data.set_quoted('LID_STAGING_DIR', '/var/lib/phosphor-software-manager/hostfw/staging') 42 conf_data.set('DMA_MAXSIZE', get_option('oem-ibm-dma-maxsize')) 43 add_global_arguments('-DOEM_IBM', language : 'c') 44 add_global_arguments('-DOEM_IBM', language : 'cpp') 45endif 46configure_file(output: 'config.h', 47 configuration: conf_data 48) 49 50phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') 51sdbusplus = dependency('sdbusplus') 52sdeventplus = dependency('sdeventplus') 53systemd = dependency('systemd') 54 55subdir('libpldm') 56 57if get_option('libpldm-only').disabled() 58 59libpldmutils_headers = ['.'] 60libpldmutils = library( 61 'pldmutils', 62 'common/utils.cpp', 63 version: meson.project_version(), 64 dependencies: [ 65 libpldm, 66 phosphor_dbus_interfaces, 67 sdbusplus, 68 ], 69 install: true, 70 include_directories: include_directories(libpldmutils_headers), 71) 72 73libpldmutils = declare_dependency( 74 include_directories: include_directories(libpldmutils_headers), 75 link_with: libpldmutils) 76subdir('libpldmresponder') 77 78deps = [ 79 libpldm, 80 libpldmutils, 81 libpldmresponder, 82 libpldmutils, 83 sdbusplus, 84 sdeventplus, 85 phosphor_dbus_interfaces 86] 87 88executable( 89 'pldmd', 90 'pldmd/pldmd.cpp', 91 'pldmd/dbus_impl_requester.cpp', 92 'pldmd/instance_id.cpp', 93 'pldmd/dbus_impl_pdr.cpp', 94 'host-bmc/dbus_to_host_effecters.cpp', 95 implicit_include_directories: false, 96 dependencies: deps, 97 install: true, 98 install_dir: get_option('bindir')) 99 100systemd_system_unit_dir = systemd.get_pkgconfig_variable( 101 'systemdsystemunitdir', 102 define_variable: ['prefix', get_option('prefix')]) 103 104configure_file( 105 copy: true, 106 input: 'pldmd/service_files/pldmd.service', 107 install: true, 108 install_dir: systemd_system_unit_dir, 109 output: 'pldmd.service', 110) 111 112if get_option('oem-ibm').enabled() 113 subdir('oem/ibm/service_files') 114endif 115 116subdir('pldmtool') 117 118subdir('configurations') 119 120if get_option('tests').enabled() 121 subdir('test') 122endif 123 124if get_option('utilities').enabled() 125 subdir('utilities') 126endif 127 128if get_option('softoff').enabled() 129 subdir('softoff') 130endif 131 132endif # pldm-only 133