File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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)
You can’t perform that action at this time.
0 commit comments