forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from readline to editline (project-chip#20330)
Readline is GPL'd software and may not be available in the build environment. Vendor editline which is permissively licensed and drop it in as a replacement for readline.
- Loading branch information
Showing
9 changed files
with
361 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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. | ||
|
||
declare_args() { | ||
# Root directory for editline. | ||
editline_root = "//third_party/editline" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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. | ||
|
||
declare_args() { | ||
# Root directory for editline. | ||
editline_root = "//third_party/connectedhomeip/third_party/editline" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# 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) | ||
|
||
config("config") { | ||
include_dirs = [ | ||
".", | ||
"${chip_root}/src/darwin/Framework/CHIP/zap-generated", | ||
"${chip_root}/src/darwin/Framework/CHIP", | ||
"${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/commands/clusters/ComplexArgument.h", | ||
"/tmp/macos_framework_output", | ||
] | ||
|
||
framework_dirs = [ "/tmp/macos_framework_output" ] | ||
|
||
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 = [ | ||
# We have to include privilege-storage.cpp here, not in the "Darwin | ||
# framework" library, because otherwise the weak symbols from | ||
# RequiredPrivilege.cpp mean we never actually pull in the function from | ||
# privilege-storage.cpp. | ||
"${chip_root}/src/app/util/privilege-storage.cpp", | ||
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", | ||
"${chip_root}/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h", | ||
"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/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/storage/Commands.h", | ||
"commands/storage/StorageManagementCommand.mm", | ||
"main.mm", | ||
] | ||
|
||
if (config_use_interactive_mode) { | ||
sources += [ "commands/interactive/InteractiveCommands.mm" ] | ||
deps += [ "${editline_root}:editline" ] | ||
} | ||
|
||
if (config_enable_yaml_tests) { | ||
sources += [ "${chip_root}/zzz_generated/darwin-framework-tool/zap-generated/cluster/MTRTestClustersObjc.mm" ] | ||
} | ||
|
||
deps = [ | ||
"${chip_root}/examples/chip-tool:chip-tool-utils", | ||
"${chip_root}/src/app/server", | ||
"${chip_root}/src/darwin/Framework/CHIP:static-matter", | ||
"${chip_root}/src/lib", | ||
"${chip_root}/src/platform", | ||
"${chip_root}/third_party/inipp", | ||
"${chip_root}/third_party/jsoncpp", | ||
] | ||
|
||
frameworks = [ | ||
"Matter.framework", | ||
"Security.framework", | ||
] | ||
|
||
public_configs = [ ":config" ] | ||
|
||
output_dir = root_out_dir | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 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. | ||
|
||
config("editline_config") { | ||
include_dirs = [ "repo/include" ] | ||
} | ||
|
||
static_library("editline") { | ||
public = [ "repo/include/editline.h" ] | ||
|
||
sources = [ | ||
"repo/src/complete.c", | ||
"repo/src/editline.c", | ||
"repo/src/editline.h", | ||
"repo/src/sysunix.c", | ||
"repo/src/unix.h", | ||
] | ||
|
||
public_configs = [ ":editline_config" ] | ||
|
||
include_dirs = [ "include" ] | ||
} |
Oops, something went wrong.