Skip to content

Commit

Permalink
[placeholder] Allow applications can specify which additional sources…
Browse files Browse the repository at this point in the history
… to build (project-chip#25346)
  • Loading branch information
vivien-apple authored and David Lechner committed Mar 22, 2023
1 parent a029dee commit 088803b
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 12 deletions.
13 changes: 1 addition & 12 deletions examples/placeholder/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,10 @@
import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${chip_root}/src/app/chip_data_model.gni")

declare_args() {
chip_tests_zap_config = "none"
}

chip_data_model("configuration") {
zap_file = "apps/${chip_tests_zap_config}/config.zap"

zap_pregenerated_dir = "${chip_root}/zzz_generated/placeholder/${chip_tests_zap_config}/zap-generated"
is_server = true
}

config("includes") {
include_dirs = [
".",
Expand All @@ -41,13 +32,11 @@ executable("chip-${chip_tests_zap_config}") {
"AppOptions.cpp",
"InteractiveServer.cpp",
"main.cpp",
"src/bridged-actions-stub.cpp",
"static-supported-modes-manager.cpp",
]

deps = [
":configuration",
"${chip_root}/examples/common/websocket-server",
"${chip_root}/examples/placeholder/linux/apps/${chip_tests_zap_config}:${chip_tests_zap_config}",
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/app/tests/suites/commands/delay",
"${chip_root}/src/app/tests/suites/commands/discovery",
Expand Down
38 changes: 38 additions & 0 deletions examples/placeholder/linux/apps/app1/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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.

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

chip_data_model("configuration") {
zap_file = "config.zap"

zap_pregenerated_dir =
"${chip_root}/zzz_generated/placeholder/app1/zap-generated"
is_server = true
}

source_set("app1") {
include_dirs = [
".",
"../../include",
]

sources = [
"../../src/bridged-actions-stub.cpp",
"../../static-supported-modes-manager.cpp",
]

public_deps = [ ":configuration" ]
}
38 changes: 38 additions & 0 deletions examples/placeholder/linux/apps/app2/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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.

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

chip_data_model("configuration") {
zap_file = "config.zap"

zap_pregenerated_dir =
"${chip_root}/zzz_generated/placeholder/app2/zap-generated"
is_server = true
}

source_set("app2") {
include_dirs = [
".",
"../../include",
]

sources = [
"../../src/bridged-actions-stub.cpp",
"../../static-supported-modes-manager.cpp",
]

public_deps = [ ":configuration" ]
}

0 comments on commit 088803b

Please sign in to comment.