blob: 27afb8f00480a7259965e23e4de0946adb0ba91d [file] [log] [blame]
William A. Kennington IIIdffd6522022-02-08 01:40:43 -08001# 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(
Patrick Williams24c61c72025-02-01 08:38:07 -050016 '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'],
William A. Kennington IIIdffd6522022-02-08 01:40:43 -080021)
22
Patrick Williams24c61c72025-02-01 08:38:07 -050023deps = [dependency('sdeventplus'), dependency('stdplus')]
William A. Kennington IIIdffd6522022-02-08 01:40:43 -080024
25libexecdir = get_option('prefix') / get_option('libexecdir')
Yuxiao Zhang1e760602024-03-07 12:35:24 -080026bindir = get_option('prefix') / get_option('bindir')
27
28fileio_lib = static_library(
Patrick Williams24c61c72025-02-01 08:38:07 -050029 'fileio',
30 ['file-io.cpp'],
31 implicit_include_directories: false,
32)
William A. Kennington IIIdffd6522022-02-08 01:40:43 -080033
34executable(
Patrick Williams24c61c72025-02-01 08:38:07 -050035 '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)
William A. Kennington IIIdffd6522022-02-08 01:40:43 -080043
Yuxiao Zhang1e760602024-03-07 12:35:24 -080044executable(
Patrick Williams24c61c72025-02-01 08:38:07 -050045 '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)
Yuxiao Zhang1e760602024-03-07 12:35:24 -080053
William A. Kennington IIIdffd6522022-02-08 01:40:43 -080054systemd = dependency('systemd')
Patrick Williams4c4e94f2023-04-12 08:01:25 -050055systemunitdir = systemd.get_variable('systemdsystemunitdir')
William A. Kennington IIIdffd6522022-02-08 01:40:43 -080056
57configure_file(
Patrick Williams24c61c72025-02-01 08:38:07 -050058 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)
Yuxiao Zhang1e760602024-03-07 12:35:24 -080064
65build_tests = get_option('tests')
66
Patrick Williamsa2d0c9e2025-01-30 17:48:13 -050067#if build_tests.allowed()
Yuxiao Zhang1e760602024-03-07 12:35:24 -080068subdir('test')
69#endif