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( |
| 16 | 'acpi_power_stated', |
| 17 | 'cpp', |
| 18 | version: '0.1', |
| 19 | default_options: [ |
| 20 | 'warning_level=3', |
| 21 | 'werror=true', |
Willy Tu | 382d628 | 2021-10-21 13:31:14 -0700 | [diff] [blame] | 22 | 'cpp_std=c++20', |
Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 23 | ], |
| 24 | ) |
| 25 | |
| 26 | headers = include_directories('.') |
| 27 | |
| 28 | systemd = dependency('systemd') |
| 29 | systemunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') |
| 30 | |
| 31 | deps = [ |
| 32 | systemd, |
| 33 | dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), |
William A. Kennington III | 570b08f | 2021-06-17 20:06:32 -0700 | [diff] [blame] | 34 | dependency( |
| 35 | 'phosphor-dbus-interfaces', |
| 36 | fallback: ['phosphor-dbus-interfaces', 'phosphor_dbus_interfaces_dep']), |
Brandon Kim | 15fe169 | 2021-03-08 21:29:39 -0800 | [diff] [blame] | 37 | ] |
| 38 | |
| 39 | bindir = get_option('prefix') / get_option('bindir') |
| 40 | |
| 41 | executable( |
| 42 | 'acpi_power_stated', |
| 43 | 'acpi_power_state.cpp', |
| 44 | include_directories: headers, |
| 45 | implicit_include_directories: false, |
| 46 | dependencies: deps, |
| 47 | install: true, |
| 48 | install_dir: bindir) |
| 49 | |
| 50 | configure_file( |
| 51 | configuration: {'BIN': bindir / 'acpi_power_stated'}, |
| 52 | input: 'acpi-power-state.service.in', |
| 53 | output: 'acpi-power-state.service', |
| 54 | install_mode: 'rw-r--r--', |
| 55 | install_dir: systemunitdir) |
| 56 | |
| 57 | install_data( |
| 58 | 'host-s0-state.target', |
| 59 | 'host-s5-state.target', |
| 60 | install_mode: 'rw-r--r--', |
| 61 | install_dir: systemunitdir) |