diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e5a50fce..3b79a5933 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,8 +99,17 @@ elseif (MLX_BUILD_METAL) endif() MESSAGE(STATUS "Downloading json") -find_package(nlohmann_json 3.11.3 REQUIRED) -target_link_libraries(mlx nlohmann_json::nlohmann_json) +FetchContent_Declare( + json + GIT_REPOSITORY "https://github.com/nlohmann/json" + GIT_TAG "v3.11.3" +) +FetchContent_MakeAvailable(json) +target_include_directories( + mlx PUBLIC + $ + $ +) find_library(ACCELERATE_LIBRARY Accelerate) if (MLX_BUILD_ARM AND ACCELERATE_LIBRARY) diff --git a/mlx/safetensor.h b/mlx/safetensor.h index ce5b354b2..5a6fa24b8 100644 --- a/mlx/safetensor.h +++ b/mlx/safetensor.h @@ -2,7 +2,7 @@ #pragma once -#include +#include #include "mlx/load.h" #include "mlx/ops.h" @@ -25,4 +25,4 @@ namespace mlx::core { #define ST_U16 "U16" #define ST_U32 "U32" #define ST_U64 "U64" -} // namespace mlx::core \ No newline at end of file +} // namespace mlx::core