William A. Kennington III | dffd652 | 2022-02-08 01:40:43 -0800 | [diff] [blame] | 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 | |
| 15 | project( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 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'], |
William A. Kennington III | dffd652 | 2022-02-08 01:40:43 -0800 | [diff] [blame] | 21 | ) |
| 22 | |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 23 | deps = [dependency('sdeventplus'), dependency('stdplus')] |
William A. Kennington III | dffd652 | 2022-02-08 01:40:43 -0800 | [diff] [blame] | 24 | |
| 25 | libexecdir = get_option('prefix') / get_option('libexecdir') |
Yuxiao Zhang | 1e76060 | 2024-03-07 12:35:24 -0800 | [diff] [blame] | 26 | bindir = get_option('prefix') / get_option('bindir') |
| 27 | |
| 28 | fileio_lib = static_library( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 29 | 'fileio', |
| 30 | ['file-io.cpp'], |
| 31 | implicit_include_directories: false, |
| 32 | ) |
William A. Kennington III | dffd652 | 2022-02-08 01:40:43 -0800 | [diff] [blame] | 33 | |
| 34 | executable( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 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 | ) |
William A. Kennington III | dffd652 | 2022-02-08 01:40:43 -0800 | [diff] [blame] | 43 | |
Yuxiao Zhang | 1e76060 | 2024-03-07 12:35:24 -0800 | [diff] [blame] | 44 | executable( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 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 | ) |
Yuxiao Zhang | 1e76060 | 2024-03-07 12:35:24 -0800 | [diff] [blame] | 53 | |
William A. Kennington III | dffd652 | 2022-02-08 01:40:43 -0800 | [diff] [blame] | 54 | systemd = dependency('systemd') |
Patrick Williams | 4c4e94f | 2023-04-12 08:01:25 -0500 | [diff] [blame] | 55 | systemunitdir = systemd.get_variable('systemdsystemunitdir') |
William A. Kennington III | dffd652 | 2022-02-08 01:40:43 -0800 | [diff] [blame] | 56 | |
| 57 | configure_file( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame] | 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 | ) |
Yuxiao Zhang | 1e76060 | 2024-03-07 12:35:24 -0800 | [diff] [blame] | 64 | |
| 65 | build_tests = get_option('tests') |
| 66 | |
Patrick Williams | a2d0c9e | 2025-01-30 17:48:13 -0500 | [diff] [blame] | 67 | #if build_tests.allowed() |
Yuxiao Zhang | 1e76060 | 2024-03-07 12:35:24 -0800 | [diff] [blame] | 68 | subdir('test') |
| 69 | #endif |