]> git.eshelyaron.com Git - dict.git/commitdiff
FIXED: write_sweep_module_location/0 for Windows.
authorJan Wielemaker <J.Wielemaker@vu.nl>
Thu, 3 Nov 2022 19:28:43 +0000 (20:28 +0100)
committerJan Wielemaker <J.Wielemaker@vu.nl>
Thu, 3 Nov 2022 19:28:43 +0000 (20:28 +0100)
sweep_link.pl

index 3c3d6791d5b108d498042db9ad879eabd48e7947..31663248a9b946b3199eb76e50179dfbba855bcc 100644 (file)
@@ -31,8 +31,8 @@
 */
 
 :- module(sweep_link,
-          [ write_sweep_module_location/0
-          ]).
+         [ write_sweep_module_location/0
+         ]).
 
 /** <module> Information for dynamically linking to GNU Emacs
 */
 sweep_link_version(1).
 
 write_sweep_module_location :-
+    sweep_module(Path),
     sweep_link_version(V),
     format('V ~w~n', [V]),
-    absolute_file_name(foreign('sweep-module'),
-                       Path,
-                       [file_type(executable), access(read)]),
     (   current_prolog_flag(executable_format, elf)
     ->  current_prolog_flag(libswipl, Libpath),
-        format('L ~w~n', [Libpath])
+       format('L ~w~n', [Libpath])
     ;   true
     ),
     format('M ~w~n', [Path]).
+
+sweep_module(Path) :-
+    current_prolog_flag(windows, true),
+    current_prolog_flag(executable, Exe),
+    prolog_to_os_filename(PlExe, Exe),
+    file_directory_name(PlExe, BinDir),
+    atomic_concat(BinDir, '/sweep-module.dll', Path),
+    exists_file(Path),
+    !.
+sweep_module(Path) :-
+    absolute_file_name(foreign('sweep-module'),
+                      Path,
+                      [file_type(executable), access(read)]).