|
| 1 | +# Copyright (c) 2025 Project CHIP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +import("//build_overrides/build.gni") |
| 16 | +import("//build_overrides/chip.gni") |
| 17 | + |
| 18 | +import("//build_overrides/editline.gni") |
| 19 | +import("${chip_root}/build/chip/tools.gni") |
| 20 | +import("${chip_root}/examples/camera-controller/camera-controller.gni") |
| 21 | +import("${chip_root}/src/lib/core/core.gni") |
| 22 | + |
| 23 | +assert(chip_build_tools) |
| 24 | + |
| 25 | +config("config") { |
| 26 | + include_dirs = [ |
| 27 | + ".", |
| 28 | + "${chip_root}/examples/common", |
| 29 | + "${chip_root}/zzz_generated/app-common/app-common", |
| 30 | + "${chip_root}/zzz_generated/chip-tool", |
| 31 | + "${chip_root}/src/lib", |
| 32 | + ] |
| 33 | + |
| 34 | + defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ] |
| 35 | + |
| 36 | + # Note: CONFIG_USE_LOCAL_STORAGE is tested for via #ifdef, not #if. |
| 37 | + if (config_use_local_storage) { |
| 38 | + defines += [ "CONFIG_USE_LOCAL_STORAGE" ] |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +static_library("camera-controller-utils") { |
| 43 | + sources = [ |
| 44 | + "${chip_root}/src/controller/ExamplePersistentStorage.cpp", |
| 45 | + "${chip_root}/src/controller/ExamplePersistentStorage.h", |
| 46 | + "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", |
| 47 | + "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", |
| 48 | + "commands/clusters/ModelCommand.cpp", |
| 49 | + "commands/clusters/ModelCommand.h", |
| 50 | + "commands/clusters/ReportCommand.cpp", |
| 51 | + "commands/clusters/ReportCommand.h", |
| 52 | + "commands/common/CHIPCommand.cpp", |
| 53 | + "commands/common/CHIPCommand.h", |
| 54 | + "commands/common/Command.cpp", |
| 55 | + "commands/common/Command.h", |
| 56 | + "commands/common/Commands.cpp", |
| 57 | + "commands/common/Commands.h", |
| 58 | + "commands/common/CredentialIssuerCommands.h", |
| 59 | + "commands/common/HexConversion.h", |
| 60 | + "commands/common/RemoteDataModelLogger.cpp", |
| 61 | + "commands/common/RemoteDataModelLogger.h", |
| 62 | + "commands/pairing/OpenCommissioningWindowCommand.cpp", |
| 63 | + "commands/pairing/OpenCommissioningWindowCommand.h", |
| 64 | + "commands/pairing/PairingCommand.cpp", |
| 65 | + "commands/pairing/ToTLVCert.cpp", |
| 66 | + ] |
| 67 | + |
| 68 | + deps = [ "${chip_root}/src/app:events" ] |
| 69 | + |
| 70 | + sources += [ "commands/interactive/InteractiveCommands.cpp" ] |
| 71 | + deps += [ |
| 72 | + "${chip_root}/src/platform/logging:headers", |
| 73 | + "${editline_root}:editline", |
| 74 | + ] |
| 75 | + |
| 76 | + if (chip_device_platform == "darwin") { |
| 77 | + sources += [ "commands/common/DeviceScanner.cpp" ] |
| 78 | + } |
| 79 | + |
| 80 | + public_deps = [ |
| 81 | + "${chip_root}/examples/common/tracing:commandline", |
| 82 | + "${chip_root}/src/app/server", |
| 83 | + "${chip_root}/src/app/tests/suites/commands/interaction_model", |
| 84 | + "${chip_root}/src/controller/data_model", |
| 85 | + "${chip_root}/src/credentials:file_attestation_trust_store", |
| 86 | + "${chip_root}/src/lib", |
| 87 | + "${chip_root}/src/lib/core:types", |
| 88 | + "${chip_root}/src/lib/support/jsontlv", |
| 89 | + "${chip_root}/src/platform", |
| 90 | + "${chip_root}/third_party/inipp", |
| 91 | + "${chip_root}/third_party/jsoncpp", |
| 92 | + ] |
| 93 | + |
| 94 | + public_configs = [ ":config" ] |
| 95 | + |
| 96 | + if (chip_enable_transport_trace) { |
| 97 | + public_deps += |
| 98 | + [ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ] |
| 99 | + } |
| 100 | + |
| 101 | + output_dir = root_out_dir |
| 102 | +} |
| 103 | + |
| 104 | +executable("camera-controller") { |
| 105 | + sources = [ "main.cpp" ] |
| 106 | + |
| 107 | + deps = [ |
| 108 | + ":camera-controller-utils", |
| 109 | + "${chip_root}/src/platform/logging:stdio", |
| 110 | + ] |
| 111 | + |
| 112 | + output_dir = root_out_dir |
| 113 | +} |
| 114 | + |
| 115 | +group("default") { |
| 116 | + deps = [ ":camera-controller" ] |
| 117 | +} |
0 commit comments