Skip to content

Commit

Permalink
Merge branch 'master' into disable_eventlist_attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Jul 26, 2023
2 parents d1a68dd + 7ab043c commit 1679f5b
Show file tree
Hide file tree
Showing 101 changed files with 421 additions and 288 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ jobs:
BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false"
scripts/run_in_build_env.sh "ninja -C ./out/gcc_release"
BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh
- name: Clean output
run: rm -rf ./out
- name: Run Tests with sanitizers
env:
LSAN_OPTIONS: detect_leaks=1
Expand Down
16 changes: 8 additions & 8 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.gcc.json",
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -17,7 +17,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.clang.json",
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -29,7 +29,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.mbedtls.json",
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -39,7 +39,7 @@
{
"name": "Android x64 debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-x64",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.android_x64.json",
"compilerPath": "/opt/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang",
Expand All @@ -51,7 +51,7 @@
{
"name": "Android arm64 debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-arm64",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.android_arm64.json",
"compilerPath": "/opt/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang",
Expand All @@ -63,7 +63,7 @@
{
"name": "EFR32 examples debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.efr32.json",
"compilerPath": "/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc",
Expand All @@ -75,7 +75,7 @@
{
"name": "nRF Connect examples debug (GN)",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compilerPath": "/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc",
"browse": {
Expand All @@ -86,7 +86,7 @@
{
"name": "Tizen examples debug (GN)",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compilerPath": "/opt/tizen-sdk/tools/arm-linux-gnueabi-gcc-9.2/bin/arm-linux-gnueabi-gcc",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.tizen_arm.json",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
],
"clang-format.fallbackStyle": "WebKit",
"files.trimFinalNewlines": true,
"C_Cpp.default.cppStandard": "gnu++14",
"C_Cpp.default.cppStandard": "gnu++17",
"C_Cpp.default.cStandard": "gnu11",
"cmake.configureOnOpen": false,
"search.followSymlinks": false,
Expand Down
7 changes: 1 addition & 6 deletions build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ declare_args() {
c_standard = "gnu11"

# C++ standard level (value for -std flag).
if (current_os == "linux" || current_os == "mac" || current_os == "ios" ||
current_os == "android") {
cpp_standard = "gnu++17"
} else {
cpp_standard = "gnu++14"
}
cpp_standard = "gnu++17"

# enable libfuzzer
is_libfuzzer = false
Expand Down
1 change: 0 additions & 1 deletion config/ameba/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ custom_toolchain = "//third_party/connectedhomeip/config/ameba/toolchain:ameba"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ]
cpp_standard = "c++17"
4 changes: 1 addition & 3 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ matter_get_compiler_flags_from_targets("${CONFIG_CHIP_EXTERNAL_TARGETS}")
matter_add_flags(-D__LINUX_ERRNO_EXTENSIONS__=1)
matter_add_flags(-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>)

if (CONFIG_CHIP_PW_RPC)
matter_add_gnu_cpp_standard("17")
endif()
matter_add_gnu_cpp_standard("17")

if (CONFIG_MBED_BSD_SOCKET_TRACE)
matter_add_flags(-DMBED_BSD_SOCKET_TRACE=1)
Expand Down
30 changes: 30 additions & 0 deletions config/telink/app/bootloader.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2023 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.
#

# Enable this option in case if restoring the slot0 partition is expected from slot1
# partition in case if slot0 is not bootable or damaged
CONFIG_BOOT_BOOTSTRAP=n

# Enable this option in case if SWAP_MOVE logic need to be used
CONFIG_BOOT_SWAP_USING_MOVE=y

# Enable this option in case if SWAP_MOVE using scratch logic need to be used
# Enabling this option expecting the availability of scratch partition in DTS
CONFIG_BOOT_SWAP_USING_SCRATCH=n

# Enable this option in case if the whole slot0 image need to be validated
# With disabled option the only image magic is validated
CONFIG_BOOT_VALIDATE_SLOT0=y
2 changes: 1 addition & 1 deletion config/telink/app/zephyr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

CONFIG_CHIP=y
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Logging (set CONFIG_SERIAL to 'y' to enable logging and 'n' to disable logging)
CONFIG_SERIAL=y
Expand Down
8 changes: 7 additions & 1 deletion config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,17 @@ else()
unset(GLOBAL_DTC_OVERLAY_FILE)
endif()

if(EXISTS "${CHIP_ROOT}/config/telink/app/bootloader.conf")
set(GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE "${CHIP_ROOT}/config/telink/app/bootloader.conf")
else()
unset(GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE)
endif()

if (CONFIG_CHIP_OTA_IMAGE_BUILD)
add_custom_target(build_mcuboot ALL
COMMAND
west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr
-- -DCONFIG_BOOT_SWAP_USING_MOVE=y -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE}
-- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE}
)

add_custom_target(merge_mcuboot ALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ void DishwasherMode::Shutdown()
}
if (gDishwasherModeDelegate != nullptr)
{
gDishwasherModeDelegate->~DishwasherModeDelegate();
delete gDishwasherModeDelegate;
gDishwasherModeDelegate = nullptr;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ void LaundryWasherMode::Shutdown()
}
if (gLaundryWasherModeDelegate != nullptr)
{
gLaundryWasherModeDelegate->~LaundryWasherModeDelegate();
delete gLaundryWasherModeDelegate;
gLaundryWasherModeDelegate = nullptr;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ void RvcRunMode::Shutdown()
}
if (gRvcRunModeDelegate != nullptr)
{
gRvcRunModeDelegate->~RvcRunModeDelegate();
delete gRvcRunModeDelegate;
gRvcRunModeDelegate = nullptr;
}
}

Expand Down Expand Up @@ -180,7 +181,8 @@ void RvcCleanMode::Shutdown()
}
if (gRvcCleanModeDelegate != nullptr)
{
gRvcCleanModeDelegate->~RvcCleanModeDelegate();
delete gRvcCleanModeDelegate;
gRvcCleanModeDelegate = nullptr;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ void RefrigeratorAndTemperatureControlledCabinetMode::Shutdown()
}
if (gTccModeDelegate != nullptr)
{
gTccModeDelegate->~TccModeDelegate();
delete gTccModeDelegate;
gTccModeDelegate = nullptr;
}
}

Expand Down
3 changes: 1 addition & 2 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj_dfu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj_release.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
3 changes: 1 addition & 2 deletions examples/all-clusters-minimal-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-minimal-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app-minimal)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-minimal-app/nrfconnect/prj_dfu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-minimal-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# CHIP PID: 32769 == 0x8001 (all-clusters-app-minimal)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32769
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(EXTRA_COMPONENT_DIRS

# TODO: add CHIPProjectAppConfig.h to esp32
project(chip-bridge-app)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H;-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake")
chip_app_component_codegen("${CHIP_ROOT}/examples/bridge-app/bridge-common/bridge-app.matter")
chip_app_component_zapgen("${CHIP_ROOT}/examples/bridge-app/bridge-common/bridge-app.zap")

set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14)
set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H")
target_compile_options(${COMPONENT_LIB} PUBLIC
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
Expand Down
3 changes: 1 addition & 2 deletions examples/chef/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
_REPO_BASE_PATH = os.path.join(_CHEF_SCRIPT_PATH, "../../")
_DEVICE_FOLDER = os.path.join(_CHEF_SCRIPT_PATH, "devices")
_DEVICE_LIST = [file[:-4]
for file in os.listdir(_DEVICE_FOLDER) if file.endswith(".zap")]
for file in os.listdir(_DEVICE_FOLDER) if file.endswith(".zap") and file != 'template.zap']
_CICD_CONFIG_FILE_NAME = os.path.join(_CHEF_SCRIPT_PATH, "cicd_config.json")
_CD_STAGING_DIR = os.path.join(_CHEF_SCRIPT_PATH, "staging")

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

CONFIG_CHIP=y
CONFIG_STD_CPP14=y
CONFIG_STD_CPP17=y

# This sample uses Kconfig.defaults to set options common for all
# samples. This file should contain only options specific for this sample
Expand Down
2 changes: 0 additions & 2 deletions examples/chef/silabs/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"

# Light app on EFR enables tracing server
pw_trace_BACKEND = "$dir_pw_trace_tokenized"
3 changes: 0 additions & 3 deletions examples/chip-tool/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ]

matter_enable_tracing_support = true

# Perfetto requires C++17
cpp_standard = "gnu++17"

matter_log_json_payload_hex = true
matter_log_json_payload_decode_full = true
5 changes: 1 addition & 4 deletions examples/common/tracing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ import("${chip_root}/build/chip/buildconfig_header.gni")
import("${chip_root}/src/lib/lib.gni")

declare_args() {
# TODO: cpp_standard check is not ideal, it should be >= 17,
# however for now this is what we use in compilations
matter_commandline_enable_perfetto_tracing =
current_os == "linux" && cpp_standard == "gnu++17"
matter_commandline_enable_perfetto_tracing = current_os == "linux"
}

config("default_config") {
Expand Down
3 changes: 1 addition & 2 deletions examples/light-switch-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 0 additions & 2 deletions examples/light-switch-app/genio/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ mt793x_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
Loading

0 comments on commit 1679f5b

Please sign in to comment.