summaryrefslogtreecommitdiff
path: root/firewalld.gyp
blob: 4b110e86e12642c56604bd82e44773bea79701f4 (plain)
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
57
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
{
  'target_defaults': {
    'variables': {
      'deps': [
        'libbrillo-<(libbase_ver)',
        'libchrome-<(libbase_ver)',
        'libpermission_broker-client',
      ],
    },
  },
  'targets': [
    {
      'target_name': 'libfirewalld',
      'type': 'static_library',
      'sources': [
        'firewall_daemon.cc',
        'firewall_service.cc',
        'iptables.cc',
      ],
    },
    {
      'target_name': 'firewalld-dbus-adaptor',
      'type': 'none',
      'variables': {
        'dbus_service_config': 'dbus_bindings/dbus-service-config.json',
        'dbus_adaptors_out_dir': 'include/dbus_bindings',
        'dbus_xml_extension': 'dbus-xml',
      },
      'sources': [
        'dbus_bindings/org.chromium.Firewalld.dbus-xml',
      ],
      'includes': ['../common-mk/generate-dbus-adaptors.gypi'],
    },
    {
      'target_name': 'firewalld-dbus-proxies',
      'type': 'none',
      'actions': [
        {
          'action_name': 'generate-firewalld-dbus-proxies',
          'variables': {
            'dbus_service_config': 'dbus_bindings/dbus-service-config.json',
            'proxy_output_file': 'include/firewalld/dbus-proxies.h',
            'mock_output_file': 'include/firewalld/dbus-mocks.h',
            'proxy_path_in_mocks': 'firewalld/dbus-proxies.h',
          },
          'sources': [
            'dbus_bindings/org.chromium.Firewalld.dbus-xml',
          ],
          'includes': ['../common-mk/generate-dbus-proxies.gypi'],
        },
      ],
    },
    {
      'target_name': 'firewalld',
      'type': 'executable',
      'dependencies': [
        'libfirewalld',
        'firewalld-dbus-adaptor',
      ],
      'sources': ['main.cc'],
    },
  ],
  'conditions': [
    ['USE_test == 1', {
      'targets': [
        {
          'target_name': 'firewalld_unittest',
          'type': 'executable',
          'variables': {
            'deps': [
              'libpermission_broker-client-test',
            ],
          },
          'includes': ['../common-mk/common_test.gypi'],
          'dependencies': ['libfirewalld'],
          'sources': [
            'iptables_unittest.cc',
            'mock_iptables.cc',
            'run_all_tests.cc',
          ],
        },
      ],
    }],
  ],
}