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/nlio.gni")
19 import("${chip_root}/build/chip/buildconfig_header.gni")
20 import("${chip_root}/build/chip/tests.gni")
21 import("${chip_root}/src/inet/inet.gni")
24 buildconfig_header("chip_buildconfig") {
25 header = "CHIPBuildConfig.h"
28 chip_target_style_unix = chip_target_style == "unix"
29 chip_target_style_embedded = chip_target_style == "embedded"
31 chip_config_memory_management_malloc =
32 chip_config_memory_management == "malloc"
33 chip_config_memory_management_simple =
34 chip_config_memory_management == "simple"
35 chip_config_memory_management_platform =
36 chip_config_memory_management == "platform"
38 # TODO - Move CHIP_PROJECT_CONFIG_INCLUDE, CHIP_PLATFORM_CONFIG_INCLUDE here.
39 # Currently those are also used from src/system.
41 "CHIP_FUZZING_ENABLED=false",
42 "CHIP_CONFIG_TEST=${chip_build_tests}",
43 "CHIP_ERROR_LOGGING=${chip_error_logging}",
44 "CHIP_PROGRESS_LOGGING=${chip_progress_logging}",
45 "CHIP_DETAIL_LOGGING=${chip_detail_logging}",
46 "CHIP_CONFIG_SHORT_ERROR_STR=${chip_config_short_error_str}",
47 "CHIP_CONFIG_ENABLE_ARG_PARSER=${chip_config_enable_arg_parser}",
48 "CHIP_TARGET_STYLE_UNIX=${chip_target_style_unix}",
49 "CHIP_TARGET_STYLE_EMBEDDED=${chip_target_style_embedded}",
50 "CHIP_CONFIG_MEMORY_MGMT_MALLOC=${chip_config_memory_management_malloc}",
51 "HAVE_MALLOC=${chip_config_memory_management_malloc}",
52 "HAVE_FREE=${chip_config_memory_management_malloc}",
54 "CHIP_CONFIG_MEMORY_MGMT_SIMPLE=${chip_config_memory_management_simple}",
55 "CHIP_CONFIG_MEMORY_MGMT_PLATFORM=${chip_config_memory_management_platform}",
56 "CHIP_CONFIG_MEMORY_DEBUG_CHECKS=${chip_config_memory_debug_checks}",
57 "CHIP_CONFIG_MEMORY_DEBUG_DMALLOC=${chip_config_memory_debug_dmalloc}",
58 "CHIP_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES=false",
59 "CHIP_ENABLE_INTERACTION_MODEL=${chip_enable_interaction_model}",
63 source_set("chip_config_header") {
66 "CHIPEventLoggingConfig.h",
71 "${chip_root}/src:includes",
72 "${chip_root}/src/lib:includes",
77 "${chip_root}/src/ble:ble_config_header",
78 "${chip_root}/src/system:system_config_header",
81 allow_circular_includes_from = [ "${chip_root}/src/ble:ble_config_header" ]
84 static_library("core") {
85 output_name = "libChipCore"
89 "CHIPCircularTLVBuffer.cpp",
90 "CHIPCircularTLVBuffer.h",
102 "CHIPTLVUpdater.cpp",
103 "CHIPTLVUtilities.cpp",
107 cflags = [ "-Wconversion" ]
110 ":chip_config_header",
111 "${chip_root}/src/ble",
112 "${chip_root}/src/inet",
113 "${chip_root}/src/lib/support",
114 "${chip_root}/src/system",
118 allow_circular_includes_from = [
119 "${chip_root}/src/ble",
120 "${chip_root}/src/lib/support",
121 "${chip_root}/src/inet",
122 "${chip_root}/src/system",