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 15project( 16 'acpi_power_stated', 17 'cpp', 18 version: '0.1', 19 default_options: [ 20 'warning_level=3', 21 'werror=true', 22 'cpp_std=c++17', 23 ], 24) 25 26headers = include_directories('.') 27 28systemd = dependency('systemd') 29systemunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') 30 31deps = [ 32 systemd, 33 dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), 34 dependency('phosphor-dbus-interfaces'), 35] 36 37bindir = get_option('prefix') / get_option('bindir') 38 39executable( 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 48configure_file( 49 configuration: {'BIN': bindir / 'acpi_power_stated'}, 50 input: 'acpi-power-state.service.in', 51 output: 'acpi-power-state.service', 52 install_mode: 'rw-r--r--', 53 install_dir: systemunitdir) 54 55install_data( 56 'host-s0-state.target', 57 'host-s5-state.target', 58 install_mode: 'rw-r--r--', 59 install_dir: systemunitdir) 60