From 8c1e01ec122778a431d614c7c2fc15a191287005 Mon Sep 17 00:00:00 2001 From: Gökçen Eraslan Date: Wed, 6 Jan 2016 18:52:00 +0100 Subject: Generate shared ibraries for libquackle and libquackleio --- quackleio/quackleio.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quackleio') diff --git a/quackleio/quackleio.pro b/quackleio/quackleio.pro index b48f58b..3c8b8ff 100644 --- a/quackleio/quackleio.pro +++ b/quackleio/quackleio.pro @@ -17,7 +17,7 @@ MOC_DIR = moc # enable/disable debug symbols #CONFIG += debug staticlib -CONFIG += release staticlib +CONFIG += release staticlib dll CONFIG -= x11 QMAKE_CXXFLAGS += -std=c++11 -- cgit v1.2.3 From df31cc20c63c9447ba057d599d48cc67c4555ca7 Mon Sep 17 00:00:00 2001 From: Gökçen Eraslan Date: Wed, 6 Jan 2016 18:52:51 +0100 Subject: GCGIO: Add a simple method to read GCG files using only the file names. --- quackleio/gcgio.cpp | 18 ++++++++++++++++++ quackleio/gcgio.h | 1 + 2 files changed, 19 insertions(+) (limited to 'quackleio') diff --git a/quackleio/gcgio.cpp b/quackleio/gcgio.cpp index cafbf49..30fac0f 100644 --- a/quackleio/gcgio.cpp +++ b/quackleio/gcgio.cpp @@ -30,6 +30,24 @@ GCGIO::GCGIO() { } +Quackle::Game *GCGIO::read(const QString &filename, int flags) +{ + QFile file(filename); + Quackle::Game *ret = new Quackle::Game; + + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + UVcerr << "Could not open gcg " << QuackleIO::Util::qstringToString(filename) << endl; + return ret; + } + + QTextStream in(&file); + ret = read(in, flags); + file.close(); + + return ret; +} + Quackle::Game *GCGIO::read(QTextStream &stream, int flags) { Quackle::Game *ret = new Quackle::Game; diff --git a/quackleio/gcgio.h b/quackleio/gcgio.h index 477f84f..a219c9f 100644 --- a/quackleio/gcgio.h +++ b/quackleio/gcgio.h @@ -30,6 +30,7 @@ public: GCGIO(); ~GCGIO() {}; + virtual Quackle::Game *read(const QString &filename, int flags); virtual Quackle::Game *read(QTextStream &stream, int flags); virtual bool canRead(QTextStream &stream) const; virtual void write(const Quackle::Game &game, QTextStream &stream); -- cgit v1.2.3 From 5f6c8472451d321d3d55977444c84bf676657992 Mon Sep 17 00:00:00 2001 From: Gökçen Eraslan Date: Fri, 8 Jan 2016 10:55:13 +0100 Subject: bindings: Generate all bindings from static quackle libraries for convenience. --- bindings/Makefile | 23 +++++------------------ quackle.pro | 2 +- quackleio/quackleio.pro | 2 +- 3 files changed, 7 insertions(+), 20 deletions(-) (limited to 'quackleio') diff --git a/bindings/Makefile b/bindings/Makefile index 1da34e4..577e978 100644 --- a/bindings/Makefile +++ b/bindings/Makefile @@ -1,27 +1,25 @@ CC=g++ QTFLAGS := $(shell pkg-config QtCore --cflags) +QTLIBS := $(shell pkg-config QtCore --libs) PYTHONFLAGS := $(shell pkg-config python2 --cflags) LUAFLAGS := $(shell pkg-config lua52 --cflags) INCLUDES=-I.. +QUACKLELIBS=../lib/release/libquackle.a ../quackleio/lib/release/libquackleio.a python/quackle_wrap.cxx: @test -d python || mkdir python swig -c++ -o $@ $(INCLUDES) $(QTFLAGS) -python quackle.i python/quackle_wrap.o: python/quackle_wrap.cxx - $(CC) -c -std=c++11 -fPIC $< $(QTFLAGS) $(PYTHONFLAGS) $(INCLUDES) -o $@ + $(CC) -std=c++11 -fPIC $(QTFLAGS) $(PYTHONFLAGS) $(INCLUDES) -c $< -o $@ python: python/quackle_wrap.o - ln -sf ../../lib/release/libquackle.so.0 python/libquackle.so.0 - ln -sf ../../quackleio/lib/release/libquackleio.so.0 python/libquackleio.so.0 - $(CC) -std=c++11 -shared ../lib/release/libquackle.so ../quackleio/lib/release/libquackleio.so $< -o python/_quackle.so + $(CC) -std=c++11 -shared -Wl,--whole-archive $(QUACKLELIBS) -Wl,--no-whole-archive $(QTLIBS) $< -o python/_quackle.so go: ln -sf ../quackle.i go/quackle.swigcxx - ln -sf ../../lib/release/libquackle.so go/libquackle.so - ln -sf ../../quackleio/lib/release/libquackleio.so go/libquackleio.so go build ./go/... lua/quackle_wrap.cxx: @@ -32,25 +30,14 @@ lua/quackle_wrap.o: lua/quackle_wrap.cxx $(CC) -std=c++11 -fPIC $(LUAFLAGS) $(QTFLAGS) $(INCLUDES) -c $< -o $@ lua: lua/quackle_wrap.o - ln -sf ../../lib/release/libquackle.so.0 lua/libquackle.so.0 - ln -sf ../../quackleio/lib/release/libquackleio.so.0 lua/libquackleio.so.0 - $(CC) -std=c++11 -shared $(LUAFLAGS) ../lib/release/libquackle.so ../quackleio/lib/release/libquackleio.so $< -o lua/quackle.so + $(CC) -std=c++11 -shared $(LUAFLAGS) -Wl,--whole-archive $(QUACKLELIBS) -Wl,--no-whole-archive $(QTLIBS) $< -o lua/quackle.so .PHONY: clean go clean: - -rm -rf python/libquackle.* - -rm -rf python/libquackleio.* -rm -rf python/quackle.py - -rm -rf lua/libquackle.* - -rm -rf lua/libquackleio.* - -rm -rf go/libquackle.* - -rm -rf go/libquackleio.* -rm -rf */*_wrap.cxx -rm -rf */*.o -rm -rf */*.pyc - -rm -rf */*.so -rm -rf lua -rm -rf go/quackle.swigcxx - -rm -rf go/libquackle.* - -rm -rf go/libquackleio.* diff --git a/quackle.pro b/quackle.pro index 37ce296..4bd40f4 100644 --- a/quackle.pro +++ b/quackle.pro @@ -21,7 +21,7 @@ QMAKE_CXXFLAGS += -std=c++11 # enable/disable debug symbols #CONFIG += debug staticlib -CONFIG += release staticlib dll +CONFIG += release staticlib CONFIG -= x11 # Input diff --git a/quackleio/quackleio.pro b/quackleio/quackleio.pro index 3c8b8ff..b48f58b 100644 --- a/quackleio/quackleio.pro +++ b/quackleio/quackleio.pro @@ -17,7 +17,7 @@ MOC_DIR = moc # enable/disable debug symbols #CONFIG += debug staticlib -CONFIG += release staticlib dll +CONFIG += release staticlib CONFIG -= x11 QMAKE_CXXFLAGS += -std=c++11 -- cgit v1.2.3