| 1 |
(* -*- tuareg -*- *) |
| 2 |
|
| 3 |
let bin = |
| 4 |
try |
| 5 |
match Sys.getenv "WINDRES" with |
| 6 |
| "" -> raise Not_found |
| 7 |
| x -> x |
| 8 |
with Not_found -> |
| 9 |
if Sys.word_size = 32 then |
| 10 |
"i686-w64-mingw32-windres" |
| 11 |
else |
| 12 |
"x86_64-w64-mingw32-windres" |
| 13 |
|
| 14 |
let dune = Printf.sprintf {| |
| 15 |
(library |
| 16 |
(name zeroinstall_windows) |
| 17 |
(enabled_if (or (= %%{os_type} "Win32") |
| 18 |
(= %%{os_type} "Cygwin"))) |
| 19 |
(foreign_stubs |
| 20 |
(language c) |
| 21 |
(flags -lwindows -lshell32) |
| 22 |
(names windows))) |
| 23 |
|
| 24 |
(rule |
| 25 |
(targets 0install.exe.o) |
| 26 |
(deps 0install.exe.rc 0install.exe.manifest) |
| 27 |
(action (run %s |
| 28 |
--input-format rc |
| 29 |
--input 0install.exe.rc |
| 30 |
--output-format coff |
| 31 |
--output 0install.exe.o))) |
| 32 |
|} bin |
| 33 |
|
| 34 |
let () = |
| 35 |
Jbuild_plugin.V1.send dune |