meson.build 7.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
libnm_core_inc = include_directories('.')

libnm_core_headers = files(
  'nm-connection.h',
  'nm-core-types.h',
  'nm-dbus-interface.h',
  'nm-errors.h',
  'nm-setting-8021x.h',
  'nm-setting-adsl.h',
  'nm-setting-bluetooth.h',
  'nm-setting-bond.h',
  'nm-setting-bridge-port.h',
  'nm-setting-bridge.h',
  'nm-setting-cdma.h',
  'nm-setting-connection.h',
  'nm-setting-dcb.h',
  'nm-setting-dummy.h',
  'nm-setting-generic.h',
  'nm-setting-gsm.h',
  'nm-setting-infiniband.h',
  'nm-setting-ip-config.h',
  'nm-setting-ip-tunnel.h',
  'nm-setting-ip4-config.h',
  'nm-setting-ip6-config.h',
  'nm-setting-macsec.h',
  'nm-setting-macvlan.h',
  'nm-setting-olpc-mesh.h',
  'nm-setting-ovs-bridge.h',
  'nm-setting-ovs-interface.h',
  'nm-setting-ovs-patch.h',
  'nm-setting-ovs-port.h',
  'nm-setting-ppp.h',
  'nm-setting-pppoe.h',
  'nm-setting-proxy.h',
  'nm-setting-serial.h',
  'nm-setting-tc-config.h',
  'nm-setting-team-port.h',
  'nm-setting-team.h',
  'nm-setting-tun.h',
  'nm-setting-user.h',
  'nm-setting-vlan.h',
  'nm-setting-vpn.h',
  'nm-setting-vxlan.h',
  'nm-setting-wimax.h',
  'nm-setting-wired.h',
  'nm-setting-wireless-security.h',
  'nm-setting-wireless.h',
  'nm-setting.h',
  'nm-simple-connection.h',
  'nm-utils.h',
  'nm-version.h',
  'nm-vpn-dbus-interface.h',
  'nm-vpn-editor-plugin.h',
  'nm-vpn-plugin-info.h'
)

57
libnm_core_settings_sources = files(
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
  'nm-setting-8021x.c',
  'nm-setting-adsl.c',
  'nm-setting-bluetooth.c',
  'nm-setting-bond.c',
  'nm-setting-bridge-port.c',
  'nm-setting-bridge.c',
  'nm-setting-cdma.c',
  'nm-setting-connection.c',
  'nm-setting-dcb.c',
  'nm-setting-dummy.c',
  'nm-setting-generic.c',
  'nm-setting-gsm.c',
  'nm-setting-infiniband.c',
  'nm-setting-ip-config.c',
  'nm-setting-ip-tunnel.c',
  'nm-setting-ip4-config.c',
  'nm-setting-ip6-config.c',
  'nm-setting-macsec.c',
  'nm-setting-macvlan.c',
  'nm-setting-olpc-mesh.c',
  'nm-setting-ovs-bridge.c',
  'nm-setting-ovs-interface.c',
  'nm-setting-ovs-patch.c',
  'nm-setting-ovs-port.c',
  'nm-setting-ppp.c',
  'nm-setting-pppoe.c',
  'nm-setting-proxy.c',
  'nm-setting-serial.c',
  'nm-setting-tc-config.c',
  'nm-setting-team-port.c',
  'nm-setting-team.c',
  'nm-setting-tun.c',
  'nm-setting-user.c',
  'nm-setting-vlan.c',
  'nm-setting-vpn.c',
  'nm-setting-vxlan.c',
  'nm-setting-wimax.c',
  'nm-setting-wired.c',
  'nm-setting-wireless-security.c',
97 98 99 100 101 102 103 104 105 106 107 108 109
  'nm-setting-wireless.c'
)

libnm_core_sources = libnm_core_settings_sources + files(
  'crypto.c',
  'crypto_' + crypto + '.c',
  'nm-connection.c',
  'nm-dbus-utils.c',
  'nm-errors.c',
  'nm-keyfile-reader.c',
  'nm-keyfile-utils.c',
  'nm-keyfile-writer.c',
  'nm-property-compare.c',
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
  'nm-setting.c',
  'nm-simple-connection.c',
  'nm-utils.c',
  'nm-vpn-editor-plugin.c',
  'nm-vpn-plugin-info.c'
)

enums_headers = libnm_core_headers + [version_header]
enums = 'nm-core-enum-types'

libnm_core_enums_h = gnome.mkenums(
  enums + '.h',
  sources: enums_headers,
  identifier_prefix: nm_id_prefix,
  fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#ifndef __NM_CORE_ENUM_TYPES_H__\n#define __NM_CORE_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
  vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n',
  ftail: 'G_END_DECLS\n\n#endif /* __NM_CORE_ENUM_TYPES_H__ */',
  install_header: true,
  install_dir: libnm_pkgincludedir
)

libnm_core_enums_c = gnome.mkenums(
  enums + '.c',
  sources: enums_headers,
  identifier_prefix: nm_id_prefix,
  fhead: '/* Generated by glib-mkenums. Do not edit */\n\n#include "config.h"\n\n#include "nm-core-enum-types.h"\n#include "nm-default.h"\n\n#include "nm-version-macros.h" \n#include "nm-connection.h" \n#include "nm-core-types.h" \n#include "nm-dbus-interface.h" \n#include "nm-errors.h" \n#include "nm-setting-8021x.h" \n#include "nm-setting-adsl.h" \n#include "nm-setting-bluetooth.h" \n#include "nm-setting-bond.h" \n#include "nm-setting-bridge-port.h" \n#include "nm-setting-bridge.h" \n#include "nm-setting-cdma.h" \n#include "nm-setting-connection.h" \n#include "nm-setting-dcb.h" \n#include "nm-setting-dummy.h" \n#include "nm-setting-generic.h" \n#include "nm-setting-gsm.h" \n#include "nm-setting-infiniband.h" \n#include "nm-setting-ip-config.h" \n#include "nm-setting-ip-tunnel.h" \n#include "nm-setting-ip4-config.h" \n#include "nm-setting-ip6-config.h" \n#include "nm-setting-macsec.h" \n#include "nm-setting-macvlan.h" \n#include "nm-setting-olpc-mesh.h" \n#include "nm-setting-ovs-bridge.h" \n#include "nm-setting-ovs-interface.h" \n#include "nm-setting-ovs-patch.h" \n#include "nm-setting-ovs-port.h" \n#include "nm-setting-ppp.h" \n#include "nm-setting-pppoe.h" \n#include "nm-setting-proxy.h" \n#include "nm-setting-serial.h" \n#include "nm-setting-team-port.h" \n#include "nm-setting-team.h" \n#include "nm-setting-tun.h" \n#include "nm-setting-user.h" \n#include "nm-setting-vlan.h" \n#include "nm-setting-vpn.h" \n#include "nm-setting-vxlan.h" \n#include "nm-setting-wimax.h" \n#include "nm-setting-wired.h" \n#include "nm-setting-wireless-security.h" \n#include "nm-setting-wireless.h" \n#include "nm-setting.h" \n#include "nm-simple-connection.h" \n#include "nm-utils.h" \n#include "nm-version.h" \n#include "nm-vpn-dbus-interface.h" \n#include "nm-vpn-editor-plugin.h" \n#include "nm-vpn-plugin-info.h" \n\n',
  vhead: 'GType\n@enum_name@_get_type (void)\n{\n  static volatile gsize g_define_type_id__volatile = 0;\n\n  if (g_once_init_enter (&g_define_type_id__volatile))\n    {\n      static const G@Type@Value values[] = {\n',
  vprod: '        { @VALUENAME@, "@VALUENAME@", "@valuenick@" },\n',
  vtail: '        { 0, NULL, NULL }\n      };\n      GType g_define_type_id =\n        g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);\n      g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n    }\n\n  return g_define_type_id__volatile;\n}\n'
)

libnm_core_enums = [libnm_core_enums_c, libnm_core_enums_h]

incs = [
  top_inc,
  shared_inc
]

deps = [
  crypto_dep,
  dl_dep,
  glib_dep,
  libudev_dep,
  uuid_dep
]

cflags = [
  '-DG_LOG_DOMAIN="libnm"',
  '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB',
  '-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
  '-DLOCALEDIR="@0@"'.format(nm_localedir),
  '-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
  '-DNMLIBDIR="@0@"'.format(nm_pkglibdir),
  '-DNMPLUGINDIR="@0@"'.format(nm_pkglibdir)
]

if enable_json_validation
  deps += jansson_dep
endif

libnm_core = static_library(
  'nm-core',
  sources: libnm_core_sources + libnm_core_enums + shared_sources + [version_header],
  include_directories: incs,
  dependencies: deps,
  c_args: cflags
)

enums_to_docbook = join_paths(meson.source_root(), 'tools', 'enums-to-docbook.pl')

docbooks = [
  ['nm-dbus-types', 'nm-dbus-interface.h', 'NetworkManager D-Bus API Types'],
  ['nm-vpn-dbus-types', 'nm-vpn-dbus-interface.h', 'VPN Plugin D-Bus API Types']
]

foreach docbook: docbooks
  output = docbook[0] + '.xml'

  xml = custom_target(
    output,
    input: docbook[1],
    output: output,
    capture: true,
    command: [perl, enums_to_docbook, docbook[0], docbook[2], '@INPUT@'],
    # FIXME: used to built properly api documentation
    build_by_default: true
  )

  content_files += xml.full_path()
endforeach

if enable_tests
  subdir('tests')
endif