From 8289373a38840ee15c14f81e2389dc032224983e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 7 Dec 2024 11:44:12 +0000 Subject: [PATCH] Download dlfcn-win32 --- CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb5bf54c4..fa7b4ed48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,13 +178,14 @@ if(WIN32) if(MSVC) # GGUF does not build with MSVC. set(MLX_BUILD_GGUF OFF) - else() - # Needed for building with MinGW. - find_package(dlfcn-win32 REQUIRED) - message(STATUS "dlfcn-win32 lib " ${dlfcn-win32_LIBRARIES}) - message(STATUS "dlfcn-win32 include " ${dlfcn-win32_INCLUDE_DIRS}) - target_link_libraries(mlx PUBLIC ${dlfcn-win32_LIBRARIES}) endif() + FetchContent_Declare( + dlfcn-win32 + GIT_REPOSITORY https://github.com/dlfcn-win32/dlfcn-win32.git + GIT_TAG v1.4.1) + FetchContent_MakeAvailable(dlfcn-win32) + target_include_directories(mlx PRIVATE ${dlfcn-win32_SOURCE_DIR}/src) + target_link_libraries(mlx PRIVATE dlfcn-win32) endif() find_package(MPI)