From f81880d29337414c13d805957b2a18a0785ce912 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Fri, 21 Jul 2023 14:26:51 +0300 Subject: [PATCH] Fix some MDX problems on Windows - The `c_library_flags` are required to allow the stubs to be loaded dynamically by MDX. - Fixed `dune` file to use `-cclib` as the `-l` options are for the linker rather than the compiler. --- .gitattributes | 2 ++ README.md | 3 ++- lib_eio_windows/dune | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..a3e24ba82 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# To work around MDX issues +README.md text eol=lf diff --git a/README.md b/README.md index a32e3701d..e8f645447 100644 --- a/README.md +++ b/README.md @@ -842,7 +842,8 @@ let try_mkdir path = The checks also apply to following symlinks: ```ocaml -# Unix.symlink "dir1" "link-to-dir1"; Unix.symlink "/tmp" "link-to-tmp";; +# Unix.symlink "dir1" "link-to-dir1"; + Unix.symlink (Filename.get_temp_dir_name ()) "link-to-tmp";; - : unit = () # Eio_main.run @@ fun env -> diff --git a/lib_eio_windows/dune b/lib_eio_windows/dune index cb4d98b69..879134229 100644 --- a/lib_eio_windows/dune +++ b/lib_eio_windows/dune @@ -1,12 +1,13 @@ (library (name eio_windows) (public_name eio_windows) - (library_flags :standard -ccopt -lbcrypt -ccopt -lntdll) + (library_flags :standard -cclib -lbcrypt -cclib -lntdll) (enabled_if (= %{os_type} "Win32")) (foreign_stubs (language c) (include_dirs ../lib_eio/unix/include) (names eio_windows_stubs eio_windows_cstruct_stubs)) + (c_library_flags :standard -lbcrypt -lntdll) (libraries eio eio.unix eio.utils fmt)) (rule