Skip to content

Commit d9503e6

Browse files
authored
Introduce nlohmann/json as a third-party lib (#11151)
### Summary With the goal of introducing CoreML AOT (#9800), we need to introduce [runtime/inmemoryfs/inmemory_filesystem_utils.cpp](https://github.com/pytorch/executorch/blob/main/backends/apple/coreml/runtime/inmemoryfs/inmemory_filesystem_utils.cpp). However, this [relies on nlohmann/json](https://github.com/pytorch/executorch/blob/306646390734d3766a72751a6bcd79a4817a01ba/backends/apple/coreml/runtime/inmemoryfs/inmemory_filesystem_utils.cpp#L13) — so let's just introduce it as a third-party library instead of doing a hidden clone. ### Test plan CI
1 parent 125129b commit d9503e6

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@
6767
[submodule "shim"]
6868
path = shim
6969
url = https://github.com/facebook/buck2-shims-meta
70+
[submodule "third-party/json"]
71+
path = third-party/json
72+
url = https://github.com/nlohmann/json.git

backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@
925925
"$(SRCROOT)/../include/executorch/runtime/core/portable_type/c10",
926926
"$(SRCROOT)/../sdk",
927927
"$(SRCROOT)/../util",
928-
"$(SRCROOT)/../../third-party/nlohmann_json/single_include",
928+
"$(SRCROOT)/../../../../../third-party/json/single_include",
929929
"$(SRCROOT)/../../third-party/coremltools/deps/protobuf/src",
930930
);
931931
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
@@ -957,7 +957,7 @@
957957
"$(SRCROOT)/../include/executorch/runtime/core/portable_type/c10",
958958
"$(SRCROOT)/../sdk",
959959
"$(SRCROOT)/../util",
960-
"$(SRCROOT)/../../third-party/nlohmann_json/single_include",
960+
"$(SRCROOT)/../../../../../third-party/json/single_include",
961961
"$(SRCROOT)/../../third-party/coremltools/deps/protobuf/src",
962962
);
963963
IPHONEOS_DEPLOYMENT_TARGET = 16.0;

backends/apple/coreml/scripts/install_requirements.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ mkdir "$COREMLTOOLS_DIR_PATH/build"
4949
cmake -S "$COREMLTOOLS_DIR_PATH" -B "$COREMLTOOLS_DIR_PATH/build"
5050
cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel --target mlmodel
5151

52-
echo "${green}ExecuTorch: Cloning nlohmann."
53-
git clone https://github.com/nlohmann/json.git "$COREML_DIR_PATH/third-party/nlohmann_json"
54-
STATUS=$?
55-
if [ $STATUS -ne 0 ]; then
56-
echo "${red}ExecuTorch: Failed to clone nlohmann."
57-
exit 1
58-
fi
59-
6052
echo "${green}ExecuTorch: Copying protobuf files."
6153
mkdir -p "$COREML_DIR_PATH/runtime/sdk/format/"
6254
cp -rf "$PROTOBUF_FILES_DIR_PATH" "$COREML_DIR_PATH/runtime/sdk/format/"

third-party/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
add_subdirectory(json)
78

89
# MARK: - flatbuffers
910

third-party/json

Submodule json added at ac0133e

0 commit comments

Comments
 (0)