• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16include($ENV{PW_ROOT}/pw_sensor/sensor.cmake)
17
18pw_add_library(pw_sensor.types INTERFACE
19  HEADERS
20    public/pw_sensor/types.h
21  PUBLIC_INCLUDES
22    public
23  PUBLIC_DEPS
24    pw_tokenizer
25)
26
27pw_sensor_library(pw_sensor.test_constants
28  OUT_HEADER
29    pw_sensor/generated/sensor_constants.h
30  INPUTS
31    $ENV{PW_ROOT}/pw_sensor/attributes.yaml
32    $ENV{PW_ROOT}/pw_sensor/channels.yaml
33    $ENV{PW_ROOT}/pw_sensor/triggers.yaml
34    $ENV{PW_ROOT}/pw_sensor/units.yaml
35  GENERATOR_INCLUDES
36    $ENV{PW_ROOT}
37  SOURCES
38    ${CMAKE_CURRENT_LIST_DIR}/test_sensor1.yaml
39    ${CMAKE_CURRENT_LIST_DIR}/test_sensor2.yaml
40  PUBLIC_DEPS
41    pw_sensor.types
42    pw_containers
43    pw_tokenizer
44)
45
46pw_add_library(pw_sensor INTERFACE
47  HEADERS
48    public/pw_sensor/types.h
49  PUBLIC_INCLUDES
50    public
51  PUBLIC_DEPS
52    pw_tokenizer
53)
54
55# This test does not run on CMake due to missing pw_sensor_library function.
56pw_add_test(pw_sensor.constants_test
57  SOURCES
58    attributes_test.cc
59    channels_test.cc
60    triggers_test.cc
61    units_test.cc
62  PRIVATE_DEPS
63    pw_sensor
64    pw_sensor.test_constants
65  GROUPS
66    modules
67    pw_sensor
68)
69