blob: 2a88f62614f490c668a30f3c4837bab588fcb321 [file] [log] [blame]
Wyatt Hepler0fbcdfc2020-01-02 07:53:39 -08001# Copyright 2020 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
Wyatt Hepler0a6f7632020-10-29 09:08:19 -070015include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16
Ewout van Bekkumc5c8b272022-01-26 16:23:08 -080017pw_add_module_library(pw_varint
18 HEADERS
19 public/pw_varint/varint.h
20 PUBLIC_INCLUDES
21 public
Aaron Green1f1c2512020-04-16 10:05:43 -070022 PUBLIC_DEPS
Ewout van Bekkumc5c8b272022-01-26 16:23:08 -080023 pw_polyfill.cstddef
24 pw_polyfill.span
Aaron Green1f1c2512020-04-16 10:05:43 -070025 pw_preprocessor
Ewout van Bekkumc5c8b272022-01-26 16:23:08 -080026 SOURCES
27 varint.cc
Aaron Green1f1c2512020-04-16 10:05:43 -070028)
Yuval Peressb8f3ad22021-10-26 22:55:27 -060029if(Zephyr_FOUND AND CONFIG_PIGWEED_VARINT)
30 zephyr_link_libraries(pw_varint)
31endif()
Ewout van Bekkumc5c8b272022-01-26 16:23:08 -080032
33pw_add_module_library(pw_varint.stream
34 HEADERS
35 public/pw_varint/stream.h
36 PUBLIC_INCLUDES
37 public
38 PUBLIC_DEPS
39 pw_status
40 pw_stream
41 SOURCES
42 stream.cc
43 PRIVATE_DEPS
44 pw_varint
45)
46
47pw_add_test(pw_varint.varint_test
48 SOURCES
49 varint_test.cc
50 varint_test_c.c
51 DEPS
52 pw_varint
53 GROUPS
54 modules
55 pw_varint
56)
57
58pw_add_test(pw_varint.stream_test
59 SOURCES
60 stream_test.cc
61 DEPS
62 pw_stream
63 pw_varint.stream
64 GROUPS
65 modules
66 pw_varint
67)