xref: /aosp_15_r20/external/pigweed/third_party/emboss/BUILD.gn (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2022 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
15import("//build_overrides/pigweed.gni")
16import("$dir_pw_build/python.gni")
17import("$dir_pw_build/target_types.gni")
18
19import("$dir_pw_docgen/docs.gni")
20import("$dir_pw_third_party/emboss/emboss.gni")
21
22config("default_config") {
23  # EMBOSS_DCHECK is used as an assert() for logic embedded in Emboss, where
24  # EMBOSS_CHECK is used to check preconditions on application logic (e.g.
25  # Write() checks the [requires: ...] attribute).
26  defines = [
27    "EMBOSS_CHECK=PW_DASSERT",
28    "EMBOSS_CHECK_ABORTS",
29    "EMBOSS_DCHECK=PW_DASSERT",
30    "EMBOSS_DCHECK_ABORTS",
31  ]
32  cflags_cc = [
33    "-include",
34    rebase_path("$dir_pw_assert/public/pw_assert/assert.h", root_build_dir),
35  ]
36}
37
38pw_source_set("default_overrides") {
39  public_configs = [ ":default_config" ]
40  public_deps = [ "$dir_pw_assert" ]
41}
42
43config("disable_warnings") {
44  cflags_cc = [ "-Wno-unused-parameter" ]
45}
46
47pw_source_set("cpp_utils") {
48  # emboss depends on a separate checkout not included in pigweed, so
49  # ignore gn check for this module.
50  check_includes = false
51  public = [
52    "$dir_pw_third_party_emboss/runtime/cpp/emboss_arithmetic.h",
53    "$dir_pw_third_party_emboss/runtime/cpp/emboss_arithmetic_all_known_generated.h",
54    "$dir_pw_third_party_emboss/runtime/cpp/emboss_arithmetic_maximum_operation_generated.h",
55    "$dir_pw_third_party_emboss/runtime/cpp/emboss_array_view.h",
56    "$dir_pw_third_party_emboss/runtime/cpp/emboss_bit_util.h",
57    "$dir_pw_third_party_emboss/runtime/cpp/emboss_constant_view.h",
58    "$dir_pw_third_party_emboss/runtime/cpp/emboss_cpp_types.h",
59    "$dir_pw_third_party_emboss/runtime/cpp/emboss_cpp_util.h",
60    "$dir_pw_third_party_emboss/runtime/cpp/emboss_defines.h",
61    "$dir_pw_third_party_emboss/runtime/cpp/emboss_enum_view.h",
62    "$dir_pw_third_party_emboss/runtime/cpp/emboss_maybe.h",
63    "$dir_pw_third_party_emboss/runtime/cpp/emboss_memory_util.h",
64    "$dir_pw_third_party_emboss/runtime/cpp/emboss_prelude.h",
65    "$dir_pw_third_party_emboss/runtime/cpp/emboss_text_util.h",
66    "$dir_pw_third_party_emboss/runtime/cpp/emboss_view_parameters.h",
67  ]
68  public_configs = [ ":disable_warnings" ]
69  public_deps = [ pw_third_party_emboss_CONFIG ]
70  visibility = [ "*" ]
71}
72
73# Exists solely to satisfy presubmit. embossc_runner.py is used for real in
74# build_defs.gni.
75action("embossc_runner") {
76  script = "embossc_runner.py"
77  visibility = []
78  outputs = [ "$target_gen_dir/foo" ]
79}
80
81pw_doc_group("docs") {
82  sources = [ "docs.rst" ]
83}
84