From 8f34c9a7f52cafd1be07d44809f8bbf41f04b3ed Mon Sep 17 00:00:00 2001 From: zhengyaohan Date: Fri, 26 Aug 2022 01:33:56 +0800 Subject: [PATCH] [BEKEN] update examples build files for BEKEN (#21993) * update examples build files for BEKEN * use lighting-common/lighting-app.zap --- config/beken/BUILD.gn | 5 ++- examples/lighting-app/beken/.gn | 29 ++++++++++++++ examples/lighting-app/beken/BUILD.gn | 38 ++++++++++++++++++ examples/lighting-app/beken/args.gni | 40 +++++++++++++++++++ examples/lighting-app/beken/build_overrides | 1 + .../beken/third_party/connectedhomeip | 1 + src/platform/Beken/OTAImageProcessorImpl.h | 2 +- 7 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 examples/lighting-app/beken/.gn create mode 100644 examples/lighting-app/beken/BUILD.gn create mode 100755 examples/lighting-app/beken/args.gni create mode 120000 examples/lighting-app/beken/build_overrides create mode 120000 examples/lighting-app/beken/third_party/connectedhomeip diff --git a/config/beken/BUILD.gn b/config/beken/BUILD.gn index 35e5175a89f7cd..3a0de665887e0b 100644 --- a/config/beken/BUILD.gn +++ b/config/beken/BUILD.gn @@ -21,7 +21,10 @@ import("//build_overrides/chip.gni") #import("${chip_root}/build/chip/tests.gni") group("beken") { - deps = [ "${chip_root}/src/lib" ] + deps = [ + "${chip_root}/examples/lighting-app/beken:MatterApp", + "${chip_root}/src/lib", + ] } group("default") { deps = [ ":beken" ] diff --git a/examples/lighting-app/beken/.gn b/examples/lighting-app/beken/.gn new file mode 100644 index 00000000000000..a980cbccc2297c --- /dev/null +++ b/examples/lighting-app/beken/.gn @@ -0,0 +1,29 @@ +# Copyright (c) 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") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "risc-v" + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/lighting-app/beken/BUILD.gn b/examples/lighting-app/beken/BUILD.gn new file mode 100644 index 00000000000000..58d812934aed4c --- /dev/null +++ b/examples/lighting-app/beken/BUILD.gn @@ -0,0 +1,38 @@ +# Copyright (c) 2020 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") + +static_library("MatterApp") { + public_deps = [ + "${chip_root}/examples/lighting-app/lighting-common", + "${chip_root}/src/lib", + ] + + sources = [ + "main/CHIPDeviceManager.cpp", + "main/DeviceCallbacks.cpp", + "main/DsoHack.cpp", + "main/chipinterface.cpp", + ] + + output_name = "libMatterApp" + output_dir = "${root_out_dir}/lib" + complete_static_lib = true +} + +group("default") { + deps = [ ":MatterApp" ] +} diff --git a/examples/lighting-app/beken/args.gni b/examples/lighting-app/beken/args.gni new file mode 100755 index 00000000000000..4dc3ac97f7054d --- /dev/null +++ b/examples/lighting-app/beken/args.gni @@ -0,0 +1,40 @@ +# Copyright (c) 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. + +# Options from standalone-chip.mk that differ from configure defaults. These +# options are used from examples/. + +import("//build_overrides/chip.gni") + +chip_device_platform = "beken" + +chip_project_config_include = "" +chip_system_project_config_include = "" +chip_ble_project_config_include = "" + +mbedtls_target = "${chip_root}/config/beken/mbedtls:mbedtls" +lwip_platform = "external" + +chip_build_tests = false + +chip_inet_config_enable_tcp_endpoint = true +chip_inet_config_enable_udp_endpoint = true + +chip_config_network_layer_ble = true +chip_config_memory_management = "platform" +chip_enable_additional_data_advertising = true +chip_enable_rotating_device_id = true +chip_enable_ota_requestor = true + +custom_toolchain = "${chip_root}/config/beken/toolchain:beken" diff --git a/examples/lighting-app/beken/build_overrides b/examples/lighting-app/beken/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/lighting-app/beken/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/lighting-app/beken/third_party/connectedhomeip b/examples/lighting-app/beken/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/lighting-app/beken/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/src/platform/Beken/OTAImageProcessorImpl.h b/src/platform/Beken/OTAImageProcessorImpl.h index 92652f38d650ef..cc0b54bcfc540c 100644 --- a/src/platform/Beken/OTAImageProcessorImpl.h +++ b/src/platform/Beken/OTAImageProcessorImpl.h @@ -19,7 +19,7 @@ #pragma once #include "flash_namespace_value.h" -#include + #include #include #include