11285115cSWilliam A. Kennington III# Copyright 2021 Google LLC
21285115cSWilliam A. Kennington III#
31285115cSWilliam A. Kennington III# Licensed under the Apache License, Version 2.0 (the "License");
41285115cSWilliam A. Kennington III# you may not use this file except in compliance with the License.
51285115cSWilliam A. Kennington III# You may obtain a copy of the License at
61285115cSWilliam A. Kennington III#
71285115cSWilliam A. Kennington III#      http://www.apache.org/licenses/LICENSE-2.0
81285115cSWilliam A. Kennington III#
91285115cSWilliam A. Kennington III# Unless required by applicable law or agreed to in writing, software
101285115cSWilliam A. Kennington III# distributed under the License is distributed on an "AS IS" BASIS,
111285115cSWilliam A. Kennington III# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121285115cSWilliam A. Kennington III# See the License for the specific language governing permissions and
131285115cSWilliam A. Kennington III# limitations under the License.
141285115cSWilliam A. Kennington III
151285115cSWilliam A. Kennington IIIproject(
161285115cSWilliam A. Kennington III  'acpi_power_stated',
171285115cSWilliam A. Kennington III  'cpp',
181285115cSWilliam A. Kennington III  version: '0.1',
191285115cSWilliam A. Kennington III  default_options: [
201285115cSWilliam A. Kennington III    'warning_level=3',
211285115cSWilliam A. Kennington III    'werror=true',
221dfe24eaSPatrick Williams    'cpp_std=c++23',
231285115cSWilliam A. Kennington III  ],
241285115cSWilliam A. Kennington III)
251285115cSWilliam A. Kennington III
261285115cSWilliam A. Kennington IIIheaders = include_directories('.')
271285115cSWilliam A. Kennington III
281285115cSWilliam A. Kennington IIIsystemd = dependency('systemd')
29*3a5c9f3aSPatrick Williamslibsystemd = dependency('libsystemd')
304c4e94f0SPatrick Williamssystemunitdir = systemd.get_variable('systemdsystemunitdir')
311285115cSWilliam A. Kennington III
321285115cSWilliam A. Kennington IIIdeps = [
33*3a5c9f3aSPatrick Williams  libsystemd,
341285115cSWilliam A. Kennington III  dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
35570b08f4SWilliam A. Kennington III  dependency(
36570b08f4SWilliam A. Kennington III    'phosphor-dbus-interfaces',
37570b08f4SWilliam A. Kennington III    fallback: ['phosphor-dbus-interfaces', 'phosphor_dbus_interfaces_dep']),
381285115cSWilliam A. Kennington III]
391285115cSWilliam A. Kennington III
401285115cSWilliam A. Kennington IIIbindir = get_option('prefix') / get_option('bindir')
411285115cSWilliam A. Kennington III
421285115cSWilliam A. Kennington IIIexecutable(
431285115cSWilliam A. Kennington III  'acpi_power_stated',
441285115cSWilliam A. Kennington III  'acpi_power_state.cpp',
451285115cSWilliam A. Kennington III  include_directories: headers,
461285115cSWilliam A. Kennington III  implicit_include_directories: false,
471285115cSWilliam A. Kennington III  dependencies: deps,
481285115cSWilliam A. Kennington III  install: true,
491285115cSWilliam A. Kennington III  install_dir: bindir)
501285115cSWilliam A. Kennington III
511285115cSWilliam A. Kennington IIIconfigure_file(
521285115cSWilliam A. Kennington III  configuration: {'BIN': bindir / 'acpi_power_stated'},
531285115cSWilliam A. Kennington III  input: 'acpi-power-state.service.in',
541285115cSWilliam A. Kennington III  output: 'acpi-power-state.service',
551285115cSWilliam A. Kennington III  install_mode: 'rw-r--r--',
561285115cSWilliam A. Kennington III  install_dir: systemunitdir)
571285115cSWilliam A. Kennington III
581285115cSWilliam A. Kennington IIIinstall_data(
591285115cSWilliam A. Kennington III  'host-s0-state.target',
601285115cSWilliam A. Kennington III  'host-s5-state.target',
611285115cSWilliam A. Kennington III  install_mode: 'rw-r--r--',
621285115cSWilliam A. Kennington III  install_dir: systemunitdir)
63