Sfoglia il codice sorgente

Trying to get goyaml to build on Windows.

John Arbash Meinel 13 anni fa
parent
commit
93d787c44d
3 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 1 0
      api.c
  2. 2 0
      decode.go
  3. 3 2
      helpers.h

+ 1 - 0
api.c

@@ -1,5 +1,6 @@
 
 
 #include "yaml_private.h"
 #include "yaml_private.h"
+#include "helpers.h"
 
 
 /*
 /*
  * Get the library version.
  * Get the library version.

+ 2 - 0
decode.go

@@ -1,6 +1,8 @@
 package goyaml
 package goyaml
 
 
 // #cgo LDFLAGS: -lm -lpthread
 // #cgo LDFLAGS: -lm -lpthread
+// #cgo windows LDFLAGS: -L. -lyaml
+// #cgo windows CFLAGS: -DYAML_DECLARE_STATIC=1
 // #cgo CFLAGS: -I. -DHAVE_CONFIG_H=1
 // #cgo CFLAGS: -I. -DHAVE_CONFIG_H=1
 //
 //
 // #include "helpers.h"
 // #include "helpers.h"

+ 3 - 2
helpers.h

@@ -1,8 +1,9 @@
 #ifndef helpers_h
 #ifndef helpers_h
 #define helpers_h
 #define helpers_h
 
 
-#define CGO_LDFLAGS "-lm -lpthread"
-#define CGO_CFLAGS "-I. -DHAVE_CONFIG_H=1"
+#ifdef _WIN32
+#define strdup _strdup
+#endif
 
 
 #include <yaml.h>
 #include <yaml.h>