1 # Copyright (c) 2020-2021 Project CHIP Authors
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 import("//build_overrides/build.gni")
16 import("//build_overrides/chip.gni")
17 import("//build_overrides/nlassert.gni")
18 import("//build_overrides/nlfaultinjection.gni")
19 import("//build_overrides/nlio.gni")
21 import("${chip_root}/build/chip/chip_version.gni")
22 import("${chip_root}/build/chip/tests.gni")
23 import("${chip_root}/src/lib/core/core.gni")
25 action("gen_chip_version") {
26 script = "${chip_root}/scripts/gen_chip_version.py"
28 version_file = "${root_gen_dir}/include/CHIPVersion.h"
29 outputs = [ version_file ]
31 "--output_file=" + rebase_path(version_file, root_build_dir),
32 "--chip_major=${chip_version_major}",
33 "--chip_minor=${chip_version_minor}",
34 "--chip_patch=${chip_version_patch}",
35 "--chip_extra=${chip_version_extra}",
39 source_set("logging_constants") {
40 sources = [ "logging/Constants.h" ]
43 source_set("chip_version_header") {
44 sources = get_target_outputs(":gen_chip_version")
46 deps = [ ":gen_chip_version" ]
49 static_library("support") {
50 output_name = "libSupportLayer"
68 "CHIPPlatformMemory.cpp",
69 "CHIPPlatformMemory.h",
76 "LifetimePersistedCounter.cpp",
77 "LifetimePersistedCounter.h",
78 "PersistedCounter.cpp",
87 "SerializableIntegerSet.cpp",
88 "SerializableIntegerSet.h",
91 "UnitTestRegistration.cpp",
92 "UnitTestRegistration.h",
93 "logging/CHIPLogging.cpp",
94 "logging/CHIPLogging.h",
95 "verhoeff/Verhoeff.cpp",
96 "verhoeff/Verhoeff.h",
97 "verhoeff/Verhoeff10.cpp",
98 "verhoeff/Verhoeff16.cpp",
99 "verhoeff/Verhoeff32.cpp",
100 "verhoeff/Verhoeff36.cpp",
105 cflags = [ "-Wconversion" ]
108 ":chip_version_header",
109 ":logging_constants",
110 "${chip_root}/src/lib/core:chip_config_header",
111 "${chip_root}/src/platform/logging:headers",
112 "${nlassert_root}:nlassert",
116 # These are needed because we include CHIPCore.h, which uses config
117 # options for src/ble and src/inet, however we cannot depend on those
118 # directly as such a dependency is cyclic.
120 "${chip_root}/src/ble:ble_config_header",
121 "${chip_root}/src/inet:inet_config_header",
124 # Android has no 'platform' that provides logging
125 if (current_os == "android") {
126 public_deps += [ "${chip_root}/src/platform/logging:android" ]
130 "${chip_root}/src:includes",
131 "${chip_root}/src/lib:includes",
132 "${chip_root}/src/system:system_config",
135 if (chip_config_memory_management == "simple") {
136 sources += [ "CHIPMem-Simple.cpp" ]
138 if (chip_config_memory_management == "malloc") {
139 sources += [ "CHIPMem-Malloc.cpp" ]
141 if (chip_with_nlfaultinjection) {
143 "CHIPFaultInjection.cpp",
144 "CHIPFaultInjection.h",
146 public_deps += [ "${nlfaultinjection_root}:nlfaultinjection" ]
149 if (chip_config_memory_debug_dmalloc) {
150 libs += [ "dmallocthcxx" ]