1# 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 15load("@rules_cc//cc:cc_library.bzl", "cc_library") 16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") 17load("//pw_build:compatibility.bzl", "incompatible_with_mcu") 18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 19 20package( 21 default_visibility = ["//visibility:public"], 22) 23 24licenses(["notice"]) 25 26cc_library( 27 name = "pw_random", 28 hdrs = [ 29 "public/pw_random/random.h", 30 "public/pw_random/xor_shift.h", 31 ], 32 strip_include_prefix = "public", 33 deps = [ 34 "//pw_assert:assert", 35 "//pw_assert:check", 36 "//pw_bytes", 37 "//pw_span", 38 "//pw_status", 39 ], 40) 41 42cc_library( 43 name = "fuzzer_generator", 44 hdrs = ["public/pw_random/fuzzer.h"], 45 strip_include_prefix = "public", 46 deps = [ 47 ":pw_random", 48 "//pw_bytes", 49 "//pw_fuzzer:libfuzzer", 50 ], 51) 52 53pw_cc_test( 54 name = "xor_shift_test", 55 srcs = ["xor_shift_test.cc"], 56 deps = [ 57 ":pw_random", 58 "//pw_assert:config", 59 "//pw_bytes", 60 ], 61) 62 63filegroup( 64 name = "doxygen", 65 srcs = [ 66 "public/pw_random/random.h", 67 "public/pw_random/xor_shift.h", 68 ], 69) 70 71sphinx_docs_library( 72 name = "docs", 73 srcs = [ 74 "backends.rst", 75 "docs.rst", 76 ], 77 prefix = "pw_random/", 78 target_compatible_with = incompatible_with_mcu(), 79) 80