xref: /openbmc/google-misc/libcr51sign/subprojects/dhcp-done/meson.build (revision 24c61c7ee8583830fd0916b7b2c7bf0561569e0f)
1# Copyright 2022 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15project(
16    'dhcp-done',
17    'cpp',
18    version: '0.1',
19    meson_version: '>=1.1.1',
20    default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
21)
22
23deps = [dependency('sdeventplus'), dependency('stdplus')]
24
25libexecdir = get_option('prefix') / get_option('libexecdir')
26bindir = get_option('prefix') / get_option('bindir')
27
28fileio_lib = static_library(
29    'fileio',
30    ['file-io.cpp'],
31    implicit_include_directories: false,
32)
33
34executable(
35    'dhcp-done',
36    'dhcp-done.cpp',
37    implicit_include_directories: false,
38    dependencies: deps,
39    link_with: fileio_lib,
40    install: true,
41    install_dir: libexecdir,
42)
43
44executable(
45    'update-dhcp-status',
46    'update-dhcp-status.cpp',
47    implicit_include_directories: false,
48    dependencies: deps,
49    link_with: fileio_lib,
50    install: true,
51    install_dir: bindir,
52)
53
54systemd = dependency('systemd')
55systemunitdir = systemd.get_variable('systemdsystemunitdir')
56
57configure_file(
58    configuration: {'BIN': libexecdir / 'dhcp-done'},
59    input: 'dhcp-done.service.in',
60    output: 'dhcp-done.service',
61    install_mode: 'rw-r--r--',
62    install_dir: systemunitdir,
63)
64
65build_tests = get_option('tests')
66
67#if build_tests.allowed()
68subdir('test')
69#endif
70