connectedhomeip: supports specifying CHIP_ROOT from the cmake parameter.
support CI compilation for the matter community https://github.com/project-chip/connectedhomeip/pull/31236 Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
943aa68069
commit
c6051e4c41
@ -65,8 +65,11 @@ if(CONFIG_MATTER)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
get_filename_component(
|
get_filename_component(
|
||||||
CHIP_ROOT ${NUTTX_APPS_DIR}/netutils/connectedhomeip/connectedhomeip
|
LOCAL_CHIP_ROOT ${NUTTX_APPS_DIR}/netutils/connectedhomeip/connectedhomeip
|
||||||
REALPATH)
|
REALPATH)
|
||||||
|
if(NOT CHIP_ROOT)
|
||||||
|
set(CHIP_ROOT ${LOCAL_CHIP_ROOT})
|
||||||
|
endif()
|
||||||
|
|
||||||
chip_download_and_patch(
|
chip_download_and_patch(
|
||||||
NAME
|
NAME
|
||||||
@ -74,7 +77,7 @@ if(CONFIG_MATTER)
|
|||||||
URL
|
URL
|
||||||
https://github.com/project-chip/connectedhomeip/archive/refs/tags/v1.2.0.1.zip
|
https://github.com/project-chip/connectedhomeip/archive/refs/tags/v1.2.0.1.zip
|
||||||
SOURCE_DIR
|
SOURCE_DIR
|
||||||
${CMAKE_CURRENT_LIST_DIR}/connectedhomeip
|
${CHIP_ROOT}
|
||||||
BINARY_DIR
|
BINARY_DIR
|
||||||
${CMAKE_BINARY_DIR}/apps/netutils/connectedhomeip
|
${CMAKE_BINARY_DIR}/apps/netutils/connectedhomeip
|
||||||
TIMEOUT
|
TIMEOUT
|
||||||
@ -166,16 +169,16 @@ if(CONFIG_MATTER)
|
|||||||
inipp
|
inipp
|
||||||
nlio/include
|
nlio/include
|
||||||
nlassert/include
|
nlassert/include
|
||||||
connectedhomeip/src
|
${CHIP_ROOT}/src
|
||||||
connectedhomeip/src/include
|
${CHIP_ROOT}/src/include
|
||||||
connectedhomeip/src/lib/dnssd
|
${CHIP_ROOT}/src/lib/dnssd
|
||||||
connectedhomeip/src/app/util/mock/include
|
${CHIP_ROOT}/src/app/util/mock/include
|
||||||
connectedhomeip/zzz_generated
|
${CHIP_ROOT}/zzz_generated
|
||||||
connectedhomeip/zzz_generated/lighting-app
|
${CHIP_ROOT}/zzz_generated/lighting-app
|
||||||
connectedhomeip/zzz_generated/app-common
|
${CHIP_ROOT}/zzz_generated/app-common
|
||||||
connectedhomeip/src/platform/Linux
|
${CHIP_ROOT}/src/platform/Linux
|
||||||
connectedhomeip/examples/platform/linux
|
${CHIP_ROOT}/examples/platform/linux
|
||||||
connectedhomeip/examples/lighting-app/lighting-common/include)
|
${CHIP_ROOT}/examples/lighting-app/lighting-common/include)
|
||||||
|
|
||||||
set(MATTER_FLAGS
|
set(MATTER_FLAGS
|
||||||
-DCHIP_HAVE_CONFIG_H
|
-DCHIP_HAVE_CONFIG_H
|
||||||
@ -259,64 +262,67 @@ if(CONFIG_MATTER)
|
|||||||
GN_DEPENDENCIES
|
GN_DEPENDENCIES
|
||||||
mbedtls)
|
mbedtls)
|
||||||
|
|
||||||
add_custom_command(
|
if(${CHIP_ROOT} STREQUAL ${LOCAL_CHIP_ROOT})
|
||||||
OUTPUT connectedhomeip/third_party/pigweed/repo
|
add_custom_command(
|
||||||
COMMAND rm ${CHIP_ROOT}/third_party/pigweed/repo -rf
|
OUTPUT connectedhomeip/third_party/pigweed/repo
|
||||||
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/pigweed
|
COMMAND rm ${CHIP_ROOT}/third_party/pigweed/repo -rf
|
||||||
${CHIP_ROOT}/third_party/pigweed/repo)
|
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/pigweed
|
||||||
|
${CHIP_ROOT}/third_party/pigweed/repo)
|
||||||
|
|
||||||
add_custom_target(chippigweed ALL
|
add_custom_target(chippigweed ALL
|
||||||
DEPENDS connectedhomeip/third_party/pigweed/repo)
|
DEPENDS connectedhomeip/third_party/pigweed/repo)
|
||||||
ExternalProject_Add_StepDependencies(chip-gn configure chippigweed)
|
ExternalProject_Add_StepDependencies(chip-gn configure chippigweed)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CHIP_ROOT}/build_overrides/pigweed_environment.gni
|
OUTPUT ${CHIP_ROOT}/build_overrides/pigweed_environment.gni
|
||||||
COMMAND touch ${CHIP_ROOT}/build_overrides/pigweed_environment.gni)
|
COMMAND touch ${CHIP_ROOT}/build_overrides/pigweed_environment.gni)
|
||||||
|
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
chipnpigweedenv ALL
|
chipnpigweedenv ALL
|
||||||
DEPENDS ${CHIP_ROOT}/build_overrides/pigweed_environment.gni)
|
DEPENDS ${CHIP_ROOT}/build_overrides/pigweed_environment.gni)
|
||||||
ExternalProject_Add_StepDependencies(chip-gn configure chipnpigweedenv)
|
ExternalProject_Add_StepDependencies(chip-gn configure chipnpigweedenv)
|
||||||
add_dependencies(chippigweed chipnpigweedenv)
|
add_dependencies(chippigweed chipnpigweedenv)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT connectedhomeip/third_party/nlassert/repo
|
OUTPUT connectedhomeip/third_party/nlassert/repo
|
||||||
COMMAND rm ${CHIP_ROOT}/third_party/nlassert/repo -rf
|
COMMAND rm ${CHIP_ROOT}/third_party/nlassert/repo -rf
|
||||||
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/nlassert
|
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/nlassert
|
||||||
${CHIP_ROOT}/third_party/nlassert/repo)
|
${CHIP_ROOT}/third_party/nlassert/repo)
|
||||||
|
|
||||||
add_custom_target(chipnlassert ALL
|
add_custom_target(chipnlassert ALL
|
||||||
DEPENDS connectedhomeip/third_party/nlassert/repo)
|
DEPENDS connectedhomeip/third_party/nlassert/repo)
|
||||||
ExternalProject_Add_StepDependencies(chip-gn configure chipnlassert)
|
ExternalProject_Add_StepDependencies(chip-gn configure chipnlassert)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT connectedhomeip/third_party/nlio/repo
|
OUTPUT connectedhomeip/third_party/nlio/repo
|
||||||
COMMAND rm ${CHIP_ROOT}/third_party/nlio/repo -rf
|
COMMAND rm ${CHIP_ROOT}/third_party/nlio/repo -rf
|
||||||
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/nlio
|
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/nlio
|
||||||
${CHIP_ROOT}/third_party/nlio/repo)
|
${CHIP_ROOT}/third_party/nlio/repo)
|
||||||
|
|
||||||
add_custom_target(chipnlio ALL DEPENDS connectedhomeip/third_party/nlio/repo)
|
add_custom_target(chipnlio ALL
|
||||||
ExternalProject_Add_StepDependencies(chip-gn configure chipnlio)
|
DEPENDS connectedhomeip/third_party/nlio/repo)
|
||||||
|
ExternalProject_Add_StepDependencies(chip-gn configure chipnlio)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT connectedhomeip/third_party/nlunit-test/repo
|
OUTPUT connectedhomeip/third_party/nlunit-test/repo
|
||||||
COMMAND rm ${CHIP_ROOT}/third_party/nlunit-test/repo -rf
|
COMMAND rm ${CHIP_ROOT}/third_party/nlunit-test/repo -rf
|
||||||
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/nlunit-test
|
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/connectedhomeip/nlunit-test
|
||||||
${CHIP_ROOT}/third_party/nlunit-test/repo)
|
${CHIP_ROOT}/third_party/nlunit-test/repo)
|
||||||
|
|
||||||
add_custom_target(chipnlunit-test ALL
|
add_custom_target(chipnlunit-test ALL
|
||||||
DEPENDS connectedhomeip/third_party/nlunit-test/repo)
|
DEPENDS connectedhomeip/third_party/nlunit-test/repo)
|
||||||
ExternalProject_Add_StepDependencies(chip-gn configure chipnlunit-test)
|
ExternalProject_Add_StepDependencies(chip-gn configure chipnlunit-test)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT connectedhomeip/third_party/jsoncpp/repo
|
OUTPUT connectedhomeip/third_party/jsoncpp/repo
|
||||||
COMMAND rm -rf ${CHIP_ROOT}/third_party/jsoncpp/repo
|
COMMAND rm -rf ${CHIP_ROOT}/third_party/jsoncpp/repo
|
||||||
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/jsoncpp/jsoncpp
|
COMMAND ln -s ${NUTTX_APPS_DIR}/netutils/jsoncpp/jsoncpp
|
||||||
${CHIP_ROOT}/third_party/jsoncpp/repo)
|
${CHIP_ROOT}/third_party/jsoncpp/repo)
|
||||||
|
|
||||||
add_custom_target(chipjsoncpp ALL
|
add_custom_target(chipjsoncpp ALL
|
||||||
DEPENDS connectedhomeip/third_party/jsoncpp/repo)
|
DEPENDS connectedhomeip/third_party/jsoncpp/repo)
|
||||||
ExternalProject_Add_StepDependencies(chip-gn configure chipjsoncpp)
|
ExternalProject_Add_StepDependencies(chip-gn configure chipjsoncpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(DEMOSRC
|
set(DEMOSRC
|
||||||
${CHIP_ROOT}/examples/lighting-app/linux/main.cpp
|
${CHIP_ROOT}/examples/lighting-app/linux/main.cpp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user