Fix GTK demo on Linux
This commit is contained in:
@@ -4,9 +4,11 @@
|
|||||||
applications with the GTK toolkit.
|
applications with the GTK toolkit.
|
||||||
|
|
||||||
To build use `./build.sh` script without arguments (or specify `TARGET` variable if cross-compiling).
|
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
|
Dialog box with the button will be shown, and application will print message
|
||||||
and terminate on button click.
|
and terminate on button click.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ DIR=.
|
|||||||
IPREFIX_macbook=-I/opt/local/include
|
IPREFIX_macbook=-I/opt/local/include
|
||||||
IPREFIX_linux=-I/usr/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_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
|
if [ x$TARGET == x ]; then
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
@@ -26,7 +26,7 @@ COMPILER_ARGS=${!var} # add -opt for an optimized build.
|
|||||||
if [ ! -f $DIR/gtk3.bc ]; then
|
if [ ! -f $DIR/gtk3.bc ]; then
|
||||||
echo "Generating GTK stubs (once), may take few mins depending on the hardware..."
|
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 \
|
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
|
-target $TARGET -o $DIR/gtk3.bc || exit 1
|
||||||
fi
|
fi
|
||||||
konanc -target $TARGET $DIR/src -library $DIR/gtk3.bc -linkerArgs "$LINKER_ARGS" -o $DIR/Gtk3Demo.kexe || exit 1
|
konanc -target $TARGET $DIR/src -library $DIR/gtk3.bc -linkerArgs "$LINKER_ARGS" -o $DIR/Gtk3Demo.kexe || exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user