xref: /openbmc/phosphor-networkd/meson.build (revision 5be691cc74a69c5a4e5cfe151d62ae6eb33e28c4)
10a01b2a9SWilliam A. Kennington IIIproject(
20a01b2a9SWilliam A. Kennington III  'phosphor-networkd',
30a01b2a9SWilliam A. Kennington III  'cpp',
40a01b2a9SWilliam A. Kennington III  version: '0.1',
5e010e562SPatrick Williams  meson_version: '>=1.1.1',
60a01b2a9SWilliam A. Kennington III  default_options: [
70a01b2a9SWilliam A. Kennington III    'warning_level=3',
8e010e562SPatrick Williams    'cpp_std=c++23',
90a01b2a9SWilliam A. Kennington III  ])
100a01b2a9SWilliam A. Kennington III
111e710d04SWilliam A. Kennington IIIdefault_busname = 'xyz.openbmc_project.Network'
121e710d04SWilliam A. Kennington III
130a01b2a9SWilliam A. Kennington IIIconf_data = configuration_data()
141e710d04SWilliam A. Kennington IIIconf_data.set_quoted('DEFAULT_BUSNAME', default_busname)
150a01b2a9SWilliam A. Kennington IIIconf_data.set('HAVE_UBOOT_ENV', get_option('uboot-env'))
160a01b2a9SWilliam A. Kennington IIIconf_data.set(
170a01b2a9SWilliam A. Kennington III  'LINK_LOCAL_AUTOCONFIGURATION',
180a01b2a9SWilliam A. Kennington III  get_option('default-link-local-autoconf'))
190a01b2a9SWilliam A. Kennington IIIconf_data.set(
200a01b2a9SWilliam A. Kennington III  'ENABLE_IPV6_ACCEPT_RA',
210a01b2a9SWilliam A. Kennington III  get_option('default-ipv6-accept-ra'))
220a01b2a9SWilliam A. Kennington IIIconf_data.set('SYNC_MAC_FROM_INVENTORY', get_option('sync-mac'))
23609c12deSJohnathan Manteyconf_data.set('PERSIST_MAC', get_option('persist-mac'))
249f621f3eSPotin Laiconf_data.set10('FORCE_SYNC_MAC_FROM_INVENTORY', get_option('force-sync-mac'))
250a01b2a9SWilliam A. Kennington III
263397be3cSPatrick Williamssdbusplus_dep = dependency('sdbusplus')
270a01b2a9SWilliam A. Kennington IIIsdbusplusplus_prog = find_program('sdbus++', native: true)
280a01b2a9SWilliam A. Kennington IIIsdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', native: true)
294b604171SWilliam A. Kennington IIIsdbusplusplus_depfiles = files()
304b604171SWilliam A. Kennington IIIif sdbusplus_dep.type_name() == 'internal'
314b604171SWilliam A. Kennington III  sdbusplusplus_depfiles = subproject('sdbusplus').get_variable('sdbusplusplus_depfiles')
324b604171SWilliam A. Kennington IIIendif
330a01b2a9SWilliam A. Kennington III
34*5be691ccSPatrick Williamsyaml_selected_subdirs = [ 'xyz' ]
35*5be691ccSPatrick Williamsshould_generate_cpp = true
36*5be691ccSPatrick Williamsshould_generate_markdown = false
37*5be691ccSPatrick Williamsshould_generate_registry = false
380a01b2a9SWilliam A. Kennington IIIsubdir('gen')
3937cf66c8SWilliam A. Kennington IIInetworkd_dbus_includes = include_directories('gen')
4037cf66c8SWilliam A. Kennington III
413397be3cSPatrick Williamsphosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
4237cf66c8SWilliam A. Kennington III
4337cf66c8SWilliam A. Kennington IIInetworkd_dbus_deps = [
4437cf66c8SWilliam A. Kennington III  phosphor_dbus_interfaces_dep,
4537cf66c8SWilliam A. Kennington III  sdbusplus_dep,
4637cf66c8SWilliam A. Kennington III]
4737cf66c8SWilliam A. Kennington III
4837cf66c8SWilliam A. Kennington IIInetworkd_dbus_lib = static_library(
4937cf66c8SWilliam A. Kennington III  'networkd_dbus',
5037cf66c8SWilliam A. Kennington III  generated_sources,
5137cf66c8SWilliam A. Kennington III  implicit_include_directories: false,
5237cf66c8SWilliam A. Kennington III  include_directories: networkd_dbus_includes,
5337cf66c8SWilliam A. Kennington III  dependencies: networkd_dbus_deps)
5437cf66c8SWilliam A. Kennington III
5537cf66c8SWilliam A. Kennington IIIgenerated_files_headers = []
5637cf66c8SWilliam A. Kennington IIIforeach s : generated_sources
5737cf66c8SWilliam A. Kennington III    foreach f : s.to_list()
5837cf66c8SWilliam A. Kennington III        p = f.full_path()
5937cf66c8SWilliam A. Kennington III        if p.endswith('.hpp')
6037cf66c8SWilliam A. Kennington III            generated_files_headers += f
6137cf66c8SWilliam A. Kennington III        endif
6237cf66c8SWilliam A. Kennington III    endforeach
6337cf66c8SWilliam A. Kennington IIIendforeach
6437cf66c8SWilliam A. Kennington III
6537cf66c8SWilliam A. Kennington IIInetworkd_dbus_dep = declare_dependency(
6637cf66c8SWilliam A. Kennington III  sources: generated_files_headers,
6737cf66c8SWilliam A. Kennington III  include_directories: networkd_dbus_includes,
6837cf66c8SWilliam A. Kennington III  link_with: networkd_dbus_lib,
6937cf66c8SWilliam A. Kennington III  dependencies: networkd_dbus_deps)
700a01b2a9SWilliam A. Kennington III
711bbe3d1eSWilliam A. Kennington IIIsubdir('src')
720a01b2a9SWilliam A. Kennington III
730a01b2a9SWilliam A. Kennington IIIconfigure_file(
7493433c16SWilliam A. Kennington III  input: '60-phosphor-networkd-default.network.in',
7593433c16SWilliam A. Kennington III  output: '60-phosphor-networkd-default.network',
7693433c16SWilliam A. Kennington III  configuration: conf_data,
7793433c16SWilliam A. Kennington III  install: true,
7893433c16SWilliam A. Kennington III  install_dir: dependency('systemd').get_variable(
79cc7f5bf0SPatrick Williams    'systemdutildir') / 'network')
8093433c16SWilliam A. Kennington III
8193433c16SWilliam A. Kennington IIIconfigure_file(
820a01b2a9SWilliam A. Kennington III  input: 'xyz.openbmc_project.Network.service.in',
830a01b2a9SWilliam A. Kennington III  output: 'xyz.openbmc_project.Network.service',
841e710d04SWilliam A. Kennington III  configuration: {
851e710d04SWilliam A. Kennington III    'SYSTEMD_TARGET': 'multi-user.target',
861e710d04SWilliam A. Kennington III    'DEFAULT_BUSNAME': default_busname,
871e710d04SWilliam A. Kennington III  },
880a01b2a9SWilliam A. Kennington III  install: true,
890a01b2a9SWilliam A. Kennington III  install_dir: dependency('systemd').get_variable(
90cc7f5bf0SPatrick Williams    'systemdsystemunitdir'))
910a01b2a9SWilliam A. Kennington III
920a01b2a9SWilliam A. Kennington IIIconfigure_file(
930a01b2a9SWilliam A. Kennington III  input: 'xyz.openbmc_project.Network.conf.in',
940a01b2a9SWilliam A. Kennington III  output: 'xyz.openbmc_project.Network.conf',
951e710d04SWilliam A. Kennington III  configuration: {'DEFAULT_BUSNAME': default_busname},
960a01b2a9SWilliam A. Kennington III  install: true,
970a01b2a9SWilliam A. Kennington III  install_dir: get_option('datadir') / 'dbus-1' / 'system.d')
980a01b2a9SWilliam A. Kennington III
990a01b2a9SWilliam A. Kennington IIIif not get_option('tests').disabled()
1000a01b2a9SWilliam A. Kennington III  subdir('test')
1010a01b2a9SWilliam A. Kennington IIIendif
102