blob: 5a7d12b40dd7932b3608c56a6ba11b8c226082c1 [file] [log] [blame]
# Copyright (c) 2020-2022 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlio.gni")
import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/inet/inet.gni")
import("core.gni")
buildconfig_header("chip_buildconfig") {
header = "CHIPBuildConfig.h"
header_dir = "core"
chip_target_style_unix = chip_target_style == "unix"
chip_target_style_embedded = chip_target_style == "embedded"
chip_config_memory_management_malloc =
chip_config_memory_management == "malloc"
chip_config_memory_management_platform =
chip_config_memory_management == "platform"
chip_config_short_error_str =
chip_config_short_error_str || chip_target_style_embedded
# TODO - Move CHIP_PROJECT_CONFIG_INCLUDE, CHIP_PLATFORM_CONFIG_INCLUDE here.
# Currently those are also used from src/system.
defines = [
"CHIP_FUZZING_ENABLED=false",
"CHIP_CONFIG_TEST=${chip_build_tests}",
"CHIP_ERROR_LOGGING=${chip_error_logging}",
"CHIP_PROGRESS_LOGGING=${chip_progress_logging}",
"CHIP_DETAIL_LOGGING=${chip_detail_logging}",
"CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE=${chip_log_message_max_size}",
"CHIP_AUTOMATION_LOGGING=${chip_automation_logging}",
"CHIP_PW_TOKENIZER_LOGGING=${chip_pw_tokenizer_logging}",
"CHIP_USE_PW_LOGGING=${chip_use_pw_logging}",
"CHIP_CONFIG_SHORT_ERROR_STR=${chip_config_short_error_str}",
"CHIP_CONFIG_ENABLE_ARG_PARSER=${chip_config_enable_arg_parser}",
"CHIP_TARGET_STYLE_UNIX=${chip_target_style_unix}",
"CHIP_TARGET_STYLE_EMBEDDED=${chip_target_style_embedded}",
"CHIP_CONFIG_MEMORY_MGMT_MALLOC=${chip_config_memory_management_malloc}",
"HAVE_MALLOC=${chip_config_memory_management_malloc}",
"HAVE_FREE=${chip_config_memory_management_malloc}",
"HAVE_NEW=false",
"CHIP_CONFIG_MEMORY_MGMT_PLATFORM=${chip_config_memory_management_platform}",
"CHIP_CONFIG_MEMORY_DEBUG_CHECKS=${chip_config_memory_debug_checks}",
"CHIP_CONFIG_MEMORY_DEBUG_DMALLOC=${chip_config_memory_debug_dmalloc}",
"CHIP_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES=false",
"CHIP_CONFIG_TRANSPORT_TRACE_ENABLED=${chip_enable_transport_trace}",
"CHIP_CONFIG_TRANSPORT_PW_TRACE_ENABLED=${chip_enable_transport_pw_trace}",
"CHIP_CONFIG_MINMDNS_DYNAMIC_OPERATIONAL_RESPONDER_LIST=${chip_config_minmdns_dynamic_operational_responder_list}",
"CHIP_CONFIG_MINMDNS_MAX_PARALLEL_RESOLVES=${chip_config_minmdns_max_parallel_resolves}",
]
}
source_set("chip_config_header") {
sources = [
"CHIPConfig.h",
"CHIPEventLoggingConfig.h",
]
public_configs = [ "${chip_root}/src:includes" ]
public_deps = [
":chip_buildconfig",
"${chip_root}/src/ble:ble_config_header",
"${chip_root}/src/system:system_config_header",
]
allow_circular_includes_from = [ "${chip_root}/src/ble:ble_config_header" ]
}
static_library("core") {
output_name = "libChipCore"
sources = [
# For now cluster enum/bitmap definitions are in zzz-generated.
# We should consider putting them directly in this directory
# instead.
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h",
"CHIPCallback.h",
"CHIPCircularTLVBuffer.cpp",
"CHIPCircularTLVBuffer.h",
"CHIPCore.h",
"CHIPEncoding.h",
"CHIPError.cpp",
"CHIPError.h",
"CHIPKeyIds.cpp",
"CHIPKeyIds.h",
"CHIPTLV.h",
"CHIPTLVDebug.cpp",
"CHIPTLVReader.cpp",
"CHIPTLVTags.h",
"CHIPTLVTypes.h",
"CHIPTLVUpdater.cpp",
"CHIPTLVUtilities.cpp",
"CHIPTLVWriter.cpp",
"ClusterEnums.h",
"DataModelTypes.h",
"GroupId.h",
"NodeId.h",
"OTAImageHeader.cpp",
"OTAImageHeader.h",
"PasscodeId.h",
"PeerId.h",
]
cflags = [ "-Wconversion" ]
public_deps = [
":chip_config_header",
"${chip_root}/src/ble",
"${chip_root}/src/inet",
"${chip_root}/src/lib/support",
"${chip_root}/src/system",
"${nlio_root}:nlio",
]
allow_circular_includes_from = [
"${chip_root}/src/ble",
"${chip_root}/src/lib/support",
"${chip_root}/src/inet",
"${chip_root}/src/system",
]
}