Chris00 / ocaml-cairo

Binding to Cairo, a 2D Vector Graphics Library.
GNU Lesser General Public License v3.0
54 stars 8 forks source link

Does not compile on cygwin #8

Closed Chimrod closed 7 years ago

Chimrod commented 7 years ago

Ocaml-cairo does not compile on cygwin. The setup search for includes in C:\… which does not make sense (cygwin use the same file organisation as any unix).

I've found the cause in setup.ml:77 and setup.ml:88

The two functions should be replaced by those one :

let cairo_cflags =
  lazy(match cairo_cflags with
       | [] ->
         (match Sys.os_type with
          | "Cygwin"
          | "Unix" -> split_on_space(pkg_config "cairo" ["--cflags-only-I"])
          …

(** Compute the correct CLIBS for Cairo. *)
let cairo_clibs =
  lazy(match cairo_clibs with
       | [] ->
         (match Sys.os_type with
          | "Cygwin"
          | "Unix" -> split_on_space(pkg_config "cairo" ["--libs"])
          …
Chris00 commented 7 years ago

In fact, Sys.os_type returns Win32 on AppVeyor—so a more sophisticated decision has to be used... (I'm working on it).

Chris00 commented 7 years ago

It does now pass the AppVeyor tests. Note that you will have to install lablgtk for now.