File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 1
- * .so
1
+ * .a
2
2
example /example
Original file line number Diff line number Diff line change
1
+ ifndef GOOS
2
+ GOOS := ` go env GOOS `
3
+ endif
4
+
1
5
ifeq ($(GOOS ) ,windows)
2
6
v8wrap.dll : v8wrap.cc v8.go
3
7
g++ -shared -o v8wrap.dll -I. -Ic:/mingw/include/v8 v8wrap.cc -lv8 -lstdc++ -lws2_32 -lwinmm
@@ -7,12 +11,19 @@ v8wrap.dll : v8wrap.cc v8.go
7
11
clean :
8
12
rm -f * .dll
9
13
else
10
- libv8wrap.so : v8wrap.cc v8.go
11
- g++ -fPIC -shared -o libv8wrap.so -I. v8wrap.cc -lv8
12
- go build .
14
+ .PHONY : go-install
15
+
16
+ all : libv8wrap.a go-install
17
+
18
+ libv8wrap.a : v8wrap.cc v8.go
19
+ g++ ` go env GOGCCFLAGS` -I. -c v8wrap.cc -lv8
20
+ ar rvs libv8wrap.a v8wrap.o
21
+ rm v8wrap.o
22
+
23
+ go-install :
13
24
go install
14
25
15
26
clean :
16
- rm -f * .so
27
+ rm -f * .a
17
28
endif
18
29
Original file line number Diff line number Diff line change 1
1
package v8
2
2
3
3
/*
4
- #cgo LDFLAGS: -L. -lv8wrap -lstdc++
4
+ #cgo LDFLAGS: -L. libv8wrap.a -lv8 -lstdc++
5
5
6
6
#include <stdlib.h>
7
7
#include "v8wrap.h"
Original file line number Diff line number Diff line change @@ -115,7 +115,6 @@ class V8Context {
115
115
private:
116
116
v8::Persistent<v8::ObjectTemplate> global_;
117
117
v8::Persistent<v8::Context> context_;
118
- v8::HandleScope handle_scope_;
119
118
std::string err_;
120
119
};
121
120
You can’t perform that action at this time.
0 commit comments