blob: 5f83a0f0c688a46fae3e1b21d7233cb339df5ea6 [file] [log] [blame]
Brandon Kim15fe1692021-03-08 21:29:39 -08001# 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',
Patrick Williams1dfe24e2023-07-12 11:16:02 -050022 'cpp_std=c++23',
Brandon Kim15fe1692021-03-08 21:29:39 -080023 ],
24)
25
26headers = include_directories('.')
27
28systemd = dependency('systemd')
Patrick Williams3a5c9f32024-09-03 16:09:26 -040029libsystemd = dependency('libsystemd')
Patrick Williams4c4e94f2023-04-12 08:01:25 -050030systemunitdir = systemd.get_variable('systemdsystemunitdir')
Brandon Kim15fe1692021-03-08 21:29:39 -080031
32deps = [
Patrick Williams3a5c9f32024-09-03 16:09:26 -040033 libsystemd,
Brandon Kim15fe1692021-03-08 21:29:39 -080034 dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
William A. Kennington III570b08f2021-06-17 20:06:32 -070035 dependency(
36 'phosphor-dbus-interfaces',
37 fallback: ['phosphor-dbus-interfaces', 'phosphor_dbus_interfaces_dep']),
Brandon Kim15fe1692021-03-08 21:29:39 -080038]
39
40bindir = get_option('prefix') / get_option('bindir')
41
42executable(
43 'acpi_power_stated',
44 'acpi_power_state.cpp',
45 include_directories: headers,
46 implicit_include_directories: false,
47 dependencies: deps,
48 install: true,
49 install_dir: bindir)
50
51configure_file(
52 configuration: {'BIN': bindir / 'acpi_power_stated'},
53 input: 'acpi-power-state.service.in',
54 output: 'acpi-power-state.service',
55 install_mode: 'rw-r--r--',
56 install_dir: systemunitdir)
57
58install_data(
59 'host-s0-state.target',
60 'host-s5-state.target',
61 install_mode: 'rw-r--r--',
62 install_dir: systemunitdir)