Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrize app-common zap-generated path #37816

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion config/common/cmake/chip_gn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ if (NOT CHIP_ROOT)
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../.. REALPATH)
endif()

if (NOT CHIP_APP_ZAP_DIR)
get_filename_component(CHIP_APP_ZAP_DIR ${CHIP_ROOT}/zzz_generated/app-common REALPATH)
endif()

# ==============================================================================
# Find required programs
# ==============================================================================
Expand Down Expand Up @@ -165,7 +169,7 @@ macro(matter_build target)
${CHIP_ROOT}/third_party/nlassert/repo/include
${CHIP_ROOT}/third_party/nlio/repo/include
${CHIP_ROOT}/third_party/nlfaultinjection/include
${CHIP_ROOT}/zzz_generated/app-common
${CHIP_APP_ZAP_DIR}
${CMAKE_CURRENT_BINARY_DIR}/gen/include
)

Expand Down
6 changes: 6 additions & 0 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ include(generate_factory_data.cmake)
if (NOT CHIP_ROOT)
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH)
endif()

if (NOT CHIP_APP_ZAP_DIR)
get_filename_component(CHIP_APP_ZAP_DIR ${CHIP_ROOT}/zzz_generated/app-common REALPATH)
endif()

get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/nrfconnect/chip-gn REALPATH)
get_filename_component(COMMON_CMAKE_SOURCE_DIR ${CHIP_ROOT}/config/common/cmake REALPATH)

Expand Down Expand Up @@ -132,6 +137,7 @@ matter_common_gn_args(
matter_add_gn_arg_string("zephyr_ar" ${CMAKE_AR})
matter_add_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})
matter_add_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER})
matter_add_gn_arg_string("chip_app_zap_dir" ${CHIP_APP_ZAP_DIR})
matter_add_gn_arg_bool ("chip_logging" CONFIG_LOG)
matter_add_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD)
matter_add_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD)
Expand Down
6 changes: 5 additions & 1 deletion src/app/chip_data_model.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

set(CHIP_APP_BASE_DIR ${CMAKE_CURRENT_LIST_DIR})

if (NOT CHIP_APP_ZAP_DIR)
get_filename_component(CHIP_APP_ZAP_DIR ${CHIP_ROOT}/zzz_generated/app-common REALPATH)
endif()

include("${CHIP_ROOT}/build/chip/chip_codegen.cmake")
include("${CHIP_ROOT}/src/data-model-providers/codegen/model.cmake")

Expand Down Expand Up @@ -144,7 +148,7 @@ function(chip_configure_data_model APP_TARGET)
add_dependencies(${APP_TARGET} ${APP_TARGET}-zapgen)

target_sources(${APP_TARGET} ${SCOPE}
${CHIP_APP_BASE_DIR}/../../zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
${CHIP_APP_ZAP_DIR}/app-common/zap-generated/attributes/Accessors.cpp
${CHIP_APP_BASE_DIR}/reporting/reporting.cpp
${CHIP_APP_BASE_DIR}/util/attribute-storage.cpp
${CHIP_APP_BASE_DIR}/util/attribute-table.cpp
Expand Down
21 changes: 11 additions & 10 deletions src/app/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@
# limitations under the License.

import("//build_overrides/chip.gni")
import("${chip_root}/src/app/common_flags.gni")

config("includes") {
include_dirs = [ "${chip_root}/zzz_generated/app-common" ]
include_dirs = [ "${chip_app_zap_dir}" ]
}

source_set("attribute-type") {
sources = [ "${chip_root}/zzz_generated/app-common/app-common/zap-generated/attribute-type.h" ]
sources = [ "${chip_app_zap_dir}/app-common/zap-generated/attribute-type.h" ]

public_configs = [ ":includes" ]
}

source_set("ids") {
sources = [
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h",
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h",
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h",
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/ids/Events.h",
"${chip_app_zap_dir}/app-common/zap-generated/ids/Attributes.h",
"${chip_app_zap_dir}/app-common/zap-generated/ids/Clusters.h",
"${chip_app_zap_dir}/app-common/zap-generated/ids/Commands.h",
"${chip_app_zap_dir}/app-common/zap-generated/ids/Events.h",
]

public_deps = [ "${chip_root}/src/app/util:types" ]
Expand All @@ -41,8 +42,8 @@ static_library("cluster-objects") {
output_name = "libClusterObjects"

sources = [
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp",
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h",
"${chip_app_zap_dir}/app-common/zap-generated/cluster-objects.cpp",
"${chip_app_zap_dir}/app-common/zap-generated/cluster-objects.h",
]

public_deps = [
Expand All @@ -61,8 +62,8 @@ static_library("cluster-objects") {

source_set("enums") {
sources = [
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h",
"${chip_root}/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h",
"${chip_app_zap_dir}/app-common/zap-generated/cluster-enums-check.h",
"${chip_app_zap_dir}/app-common/zap-generated/cluster-enums.h",
"CompatEnumNames.h",
]

Expand Down
3 changes: 3 additions & 0 deletions src/app/common_flags.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ declare_args() {
# communicated to OperationalSessionSetup API consumers.
chip_enable_busy_handling_for_operational_session_setup = true

# Flag that sets path to zap-generated app-common directory
chip_app_zap_dir = chip_root + "/zzz_generated/app-common"

# Controls whether the device commissioning process requires the user to
# acknowledge terms and conditions during commissioning.
chip_terms_and_conditions_required = false
Expand Down
Loading