Skip to content

Commit

Permalink
Fix gccgo compile failed
Browse files Browse the repository at this point in the history
Change-Id: Iee953c814d180f749af3dee4cb68ef7afd8ea25f
  • Loading branch information
jouyouyun committed Mar 23, 2017
1 parent 8914f91 commit 9ee7058
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ PREFIX = /usr

ifndef USE_GCCGO
GOBUILD = go build
GOTEST = go build
GORUN = go run
else
LDFLAGS = $(shell pkg-config --libs gobject-introspection-1.0)
LDFLAGS = $(shell pkg-config --libs gobject-introspection-1.0 gio-2.0 gudev-1.0 gdk-3.0)
GOBUILD = go build -compiler gccgo -gccgoflags "${LDFLAGS}"
GOTEST = go test -compiler gccgo -gccgoflags "${LDFLAGS}"
GORUN = go run -compiler gccgo -gccgoflags "${LDFLAGS}"
endif


Expand Down Expand Up @@ -41,12 +45,12 @@ gudev-1.0: lib.in/gudev-1.0/gudev.go.in lib.in/gudev-1.0/config.json generator
${GENERATOR} -o out/src/gir/$@ $<

test: copyfile glib-2.0 gobject-2.0 gio-2.0 gudev-1.0
cd out/src/gir/gobject-2.0 && go test
cd out/src/gir/gio-2.0 && go test
cd out/src/gir/glib-2.0 && go test
cd out/src/gir/gudev-1.0 && go test
cd out/src/gir/gobject-2.0 && ${GOTEST}
cd out/src/gir/gio-2.0 && ${GOTEST}
cd out/src/gir/glib-2.0 && ${GOTEST}
cd out/src/gir/gudev-1.0 && ${GOTEST}
@echo "Memory Testing"
GOPATH=`pwd`/out go run test/memory.go
GOPATH=`pwd`/out ${GORUN} test/memory.go

install: copyfile
install -d $(DESTDIR)$(PREFIX)/share/gocode/src/gir $(DESTDIR)$(PREFIX)/bin
Expand Down
2 changes: 1 addition & 1 deletion test/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {
})
for {
TestFunc()
if RSSinMB() > 50 {
if RSSinMB() > 60 {
fmt.Println("V:", RSSinMB())
panic("RSS beyond 50MB, detect a memory leak!")
}
Expand Down

0 comments on commit 9ee7058

Please sign in to comment.