blob: 513be497c1fb4f51d286bcd48f2535b65566d7a4 [file] [log] [blame]
# Copyright (c) 2022 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/build.gni")
import("//build_overrides/chip.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/examples//chip-tool/chip-tool.gni")
if (config_use_interactive_mode) {
import("//build_overrides/editline.gni")
}
assert(chip_build_tools)
action("build-darwin-framework") {
script = "${chip_root}/scripts/build/build_darwin_framework.py"
inputs = [
"${chip_root}/src/darwin/Framework/CHIP",
"${chip_root}/src/darwin/Framework/Matter.xcodeproj",
]
args = [
"--project_path",
rebase_path("${chip_root}/src/darwin/Framework/Matter.xcodeproj",
root_build_dir),
"--out_path",
"macos_framework_output",
"--target",
"Matter Framework",
"--log_path",
rebase_path("${root_build_dir}/darwin_framework_build.log", root_build_dir),
]
output_name = "Matter.framework"
outputs = [
"${root_out_dir}/macos_framework_output/Build/Products/Debug/${output_name}",
"${root_build_dir}/darwin_framework_build.log",
"${root_out_dir}/macos_framework_output/ModuleCache.noindex/",
"${root_out_dir}/macos_framework_output/Logs",
"${root_out_dir}/macos_framework_output/Index",
"${root_out_dir}/macos_framework_output/Build",
]
}
config("config") {
include_dirs = [
".",
"${chip_root}/examples/darwin-framework-tool/commands/common",
"${chip_root}/zzz_generated/darwin-framework-tool",
"${chip_root}/zzz_generated/controller-clusters",
"${chip_root}/examples/chip-tool",
"${chip_root}/zzz_generated/chip-tool",
"${root_out_dir}/macos_framework_output/Build/Products/Debug/",
]
framework_dirs =
[ "${root_out_dir}/macos_framework_output/Build/Products/Debug/" ]
defines = [
"CONFIG_ENABLE_YAML_TESTS=${config_enable_yaml_tests}",
"CONFIG_USE_INTERACTIVE_MODE=${config_use_interactive_mode}",
]
cflags = [
"-Wconversion",
"-fobjc-arc",
]
}
executable("darwin-framework-tool") {
sources = [
"${chip_root}/examples/chip-tool/commands/common/Command.cpp",
"${chip_root}/examples/chip-tool/commands/common/Command.h",
"${chip_root}/examples/chip-tool/commands/common/Commands.cpp",
"${chip_root}/examples/chip-tool/commands/common/Commands.h",
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp",
"commands/clusters/ClusterCommandBridge.h",
"commands/clusters/ModelCommandBridge.mm",
"commands/clusters/ReportCommandBridge.h",
"commands/clusters/WriteAttributeCommandBridge.h",
"commands/common/CHIPCommandBridge.mm",
"commands/common/CHIPCommandStorageDelegate.mm",
"commands/common/CHIPToolKeypair.mm",
"commands/common/MTRDevice_Externs.h",
"commands/common/MTRError.mm",
"commands/common/MTRError_Utils.h",
"commands/common/MTRLogging.h",
"commands/pairing/Commands.h",
"commands/pairing/OpenCommissioningWindowCommand.h",
"commands/pairing/OpenCommissioningWindowCommand.mm",
"commands/pairing/PairingCommandBridge.mm",
"commands/pairing/PairingDelegateBridge.mm",
"commands/payload/SetupPayloadParseCommand.mm",
"commands/provider/Commands.h",
"commands/provider/OTAProviderDelegate.mm",
"commands/provider/OTASoftwareUpdateInteractive.mm",
"commands/storage/Commands.h",
"commands/storage/StorageManagementCommand.mm",
"main.mm",
]
deps = [
":build-darwin-framework",
"${chip_root}/src/app/tests/suites/commands/delay",
# IM is needed for MTRError
"${chip_root}/src/app/tests/suites/commands/interaction_model",
# Log is needed by tests UserPrompt and Log
"${chip_root}/src/app/tests/suites/commands/log",
# System is needed by tests FactoryReset etc..
"${chip_root}/src/app/tests/suites/commands/system",
# pics is needed by tests
"${chip_root}/src/app/tests/suites/pics",
"${chip_root}/third_party/inipp",
"${chip_root}/third_party/jsoncpp",
]
if (config_use_interactive_mode) {
sources += [ "commands/interactive/InteractiveCommands.mm" ]
deps += [ "${editline_root}:editline" ]
}
ldflags = [
"-rpath",
"@executable_path/macos_framework_output/Build/Products/Debug/",
]
frameworks = [
"Matter.framework",
"Security.framework",
]
public_configs = [ ":config" ]
output_dir = root_out_dir
}