Fix GTK demo on Linux

This commit is contained in:
Nikolay Igotti
2017-04-21 16:48:08 +03:00
parent be646930cc
commit 13dbbd361b
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -4,9 +4,11 @@
applications with the GTK toolkit.
To build use `./build.sh` script without arguments (or specify `TARGET` variable if cross-compiling).
To run on Mac install XQuartz X server (https://www.xquartz.org/), and then
Do not forget to install GTK3.
On Mac use `port install gtk3`, on Debian flavours of Linux - `apt-get install libgtk-3-dev`.
To run on Mac also install XQuartz X server (https://www.xquartz.org/), and then
./Gtk3Demo
./Gtk3Demo.kexe
Dialog box with the button will be shown, and application will print message
and terminate on button click.
+2 -2
View File
@@ -6,7 +6,7 @@ DIR=.
IPREFIX_macbook=-I/opt/local/include
IPREFIX_linux=-I/usr/include
LINKER_ARGS_macbook="-L/opt/local/lib -lglib-2.0 -lgdk-3.0 -lgtk-3 -lgio-2.0 -lgobject-2.0"
LINKER_ARGS_linux="-L/usr/lib/x86_64-linux-gnu -lglib-2.0 -lgdk-3.0 -lgtk-3 -lgio-2.0 -lgobject-2.0"
LINKER_ARGS_linux="-L/usr/lib/x86_64-linux-gnu -lglib-2.0 -lgdk-3 -lgtk-3 -lgio-2.0 -lgobject-2.0"
if [ x$TARGET == x ]; then
case "$OSTYPE" in
@@ -26,7 +26,7 @@ COMPILER_ARGS=${!var} # add -opt for an optimized build.
if [ ! -f $DIR/gtk3.bc ]; then
echo "Generating GTK stubs (once), may take few mins depending on the hardware..."
cinterop -J-Xmx8g -copt $IPREFIX/atk-1.0 -copt $IPREFIX/gdk-pixbuf-2.0 -copt $IPREFIX/cairo -copt $IPREFIX/pango-1.0 \
-copt -I/opt/local/lib/glib-2.0/include -copt $IPREFIX/gtk-3.0 -copt $IPREFIX/glib-2.0 -def $DIR/gtk3.def \
-copt -I/opt/local/lib/glib-2.0/include -copt -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -copt $IPREFIX/gtk-3.0 -copt $IPREFIX/glib-2.0 -def $DIR/gtk3.def \
-target $TARGET -o $DIR/gtk3.bc || exit 1
fi
konanc -target $TARGET $DIR/src -library $DIR/gtk3.bc -linkerArgs "$LINKER_ARGS" -o $DIR/Gtk3Demo.kexe || exit 1