Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 1 | # Copyright 2021 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 | 'acpi_power_stated', |
| 17 | 'cpp', |
| 18 | version: '0.1', |
| 19 | default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'], |
Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 20 | ) |
| 21 | |
| 22 | headers = include_directories('.') |
| 23 | |
| 24 | systemd = dependency('systemd') |
Patrick Williams | 3a5c9f3 | 2024-09-03 16:09:26 -0400 | [diff] [blame] | 25 | libsystemd = dependency('libsystemd') |
Patrick Williams | 4c4e94f | 2023-04-12 08:01:25 -0500 | [diff] [blame] | 26 | systemunitdir = systemd.get_variable('systemdsystemunitdir') |
Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 27 | |
| 28 | deps = [ |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame^] | 29 | libsystemd, |
| 30 | dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), |
| 31 | dependency( |
| 32 | 'phosphor-dbus-interfaces', |
| 33 | fallback: ['phosphor-dbus-interfaces', 'phosphor_dbus_interfaces_dep'], |
| 34 | ), |
Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 35 | ] |
| 36 | |
| 37 | bindir = get_option('prefix') / get_option('bindir') |
| 38 | |
| 39 | executable( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame^] | 40 | 'acpi_power_stated', |
| 41 | 'acpi_power_state.cpp', |
| 42 | include_directories: headers, |
| 43 | implicit_include_directories: false, |
| 44 | dependencies: deps, |
| 45 | install: true, |
| 46 | install_dir: bindir, |
| 47 | ) |
Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 48 | |
| 49 | configure_file( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame^] | 50 | configuration: {'BIN': bindir / 'acpi_power_stated'}, |
| 51 | input: 'acpi-power-state.service.in', |
| 52 | output: 'acpi-power-state.service', |
| 53 | install_mode: 'rw-r--r--', |
| 54 | install_dir: systemunitdir, |
| 55 | ) |
Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 56 | |
| 57 | install_data( |
Patrick Williams | 24c61c7 | 2025-02-01 08:38:07 -0500 | [diff] [blame^] | 58 | 'host-s0-state.target', |
| 59 | 'host-s5-state.target', |
| 60 | install_mode: 'rw-r--r--', |
| 61 | install_dir: systemunitdir, |
| 62 | ) |