fetch json

This commit is contained in:
Awni Hannun 2023-12-19 14:49:50 -08:00 committed by dc-dc-dc
parent c043d27682
commit 3f82fe8888
2 changed files with 13 additions and 4 deletions

View File

@ -99,8 +99,17 @@ elseif (MLX_BUILD_METAL)
endif() endif()
MESSAGE(STATUS "Downloading json") MESSAGE(STATUS "Downloading json")
find_package(nlohmann_json 3.11.3 REQUIRED) FetchContent_Declare(
target_link_libraries(mlx nlohmann_json::nlohmann_json) json
GIT_REPOSITORY "https://github.com/nlohmann/json"
GIT_TAG "v3.11.3"
)
FetchContent_MakeAvailable(json)
target_include_directories(
mlx PUBLIC
$<BUILD_INTERFACE:${json_SOURCE_DIR}/single_include/nlohmann>
$<INSTALL_INTERFACE:include/json>
)
find_library(ACCELERATE_LIBRARY Accelerate) find_library(ACCELERATE_LIBRARY Accelerate)
if (MLX_BUILD_ARM AND ACCELERATE_LIBRARY) if (MLX_BUILD_ARM AND ACCELERATE_LIBRARY)

View File

@ -2,7 +2,7 @@
#pragma once #pragma once
#include <nlohmann/json.hpp> #include <json.hpp>
#include "mlx/load.h" #include "mlx/load.h"
#include "mlx/ops.h" #include "mlx/ops.h"