Skip to content

Commit 508498a

Browse files
committed
up
1 parent cc0a110 commit 508498a

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
--- a/CMakeLists.txt
3+
+++ b/CMakeLists.txt
4+
@@ -304,12 +304,18 @@ else()
5+
set(MLX_BUILD_ACCELERATE OFF)
6+
endif()
7+
8+
-message(STATUS "Downloading json")
9+
-FetchContent_Declare(
10+
- json
11+
- URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
12+
-FetchContent_MakeAvailable(json)
13+
-target_include_directories(
14+
- mlx PRIVATE $<BUILD_INTERFACE:${json_SOURCE_DIR}/single_include/nlohmann>)
15+
+# Only fetch json if nlohmann_json target doesn't already exist
16+
+# (ExecuTorch provides its own copy)
17+
+if(NOT TARGET nlohmann_json)
18+
+ message(STATUS "Downloading json")
19+
+ FetchContent_Declare(
20+
+ json
21+
+ URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
22+
+ FetchContent_MakeAvailable(json)
23+
+ target_include_directories(
24+
+ mlx PRIVATE $<BUILD_INTERFACE:${json_SOURCE_DIR}/single_include/nlohmann>)
25+
+else()
26+
+ message(STATUS "Using existing nlohmann_json target")
27+
+endif()
28+
29+
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/mlx)

0 commit comments

Comments
 (0)