mirror of
https://github.com/HerrCraziDev/tiny-kyoukai.git
synced 2025-12-13 09:36:16 +01:00
fix build on Ubuntu
This commit is contained in:
10
Makefile
10
Makefile
@@ -15,12 +15,12 @@ LIBS = x11 gtk4 gtk4-x11
|
|||||||
STATIC_LIBS =
|
STATIC_LIBS =
|
||||||
INCLUDES = -I$(HEADER_DIR)
|
INCLUDES = -I$(HEADER_DIR)
|
||||||
ifdef LIBS
|
ifdef LIBS
|
||||||
LDLIBS = $(shell pkg-config -libs $(LIBS))
|
LDLIBS = $(shell pkg-config --libs $(LIBS))
|
||||||
INCLUDES += $(shell pkg-config -cflags $(LIBS))
|
INCLUDES += $(shell pkg-config --cflags $(LIBS))
|
||||||
endif
|
endif
|
||||||
ifdef STATIC_LIBS
|
ifdef STATIC_LIBS
|
||||||
LDLIBS += -Wl,-Bstatic $(shell pkg-config -libs $(STATIC_LIBS)) -Wl,-Bdynamic
|
LDLIBS += -Wl,-Bstatic $(shell pkg-config --libs $(STATIC_LIBS)) -Wl,-Bdynamic
|
||||||
INCLUDES += $(shell pkg-config -cflags $(STATIC_LIBS))
|
INCLUDES += $(shell pkg-config --cflags $(STATIC_LIBS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SRC = $(shell find $(SOURCE_DIR)/ -type f -name '*.c') main.c
|
SRC = $(shell find $(SOURCE_DIR)/ -type f -name '*.c') main.c
|
||||||
@@ -157,7 +157,7 @@ clean:
|
|||||||
# @rm -rif $(BUILD_DIR)/*.o $(BUILD_DIR)/*.gch
|
# @rm -rif $(BUILD_DIR)/*.o $(BUILD_DIR)/*.gch
|
||||||
|
|
||||||
clear: clean
|
clear: clean
|
||||||
@rm $(PROJECT_NAME) $(RES_INC)
|
@rm -if $(PROJECT_NAME) $(RES_INC)
|
||||||
|
|
||||||
|
|
||||||
.PHONY: always init SUSSYBAKA test test-res clear clean run pregen-res
|
.PHONY: always init SUSSYBAKA test test-res clear clean run pregen-res
|
||||||
13
main.c
13
main.c
@@ -41,6 +41,12 @@
|
|||||||
#include "tiny-kyoukai.gresource.h"
|
#include "tiny-kyoukai.gresource.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if glib_minor_version < 74
|
||||||
|
#define APP_FLAGS G_APPLICATION_FLAGS_NONE
|
||||||
|
#else
|
||||||
|
#define APP_FLAGS G_APPLICATION_DEFAULT_FLAGS
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Files and resources */
|
/* Files and resources */
|
||||||
#define KYOU_ICON_PATH "ressources/"
|
#define KYOU_ICON_PATH "ressources/"
|
||||||
#define KYOU_ICON_NAME TINYKYOU_NAME
|
#define KYOU_ICON_NAME TINYKYOU_NAME
|
||||||
@@ -225,10 +231,11 @@ static void activate(GtkApplication *app, gpointer user_data) {
|
|||||||
kyou = gtk_picture_new_for_resource( KYOU_IMAGE_RESOURCE );
|
kyou = gtk_picture_new_for_resource( KYOU_IMAGE_RESOURCE );
|
||||||
#endif
|
#endif
|
||||||
gtk_picture_set_can_shrink(GTK_PICTURE(kyou), FALSE);
|
gtk_picture_set_can_shrink(GTK_PICTURE(kyou), FALSE);
|
||||||
if ( gtk_get_major_version() != 4 && gtk_get_minor_version() <= 8 )
|
#if ( gtk_minor_version < 8 )
|
||||||
gtk_picture_set_keep_aspect_ratio( GTK_PICTURE(kyou), true );
|
gtk_picture_set_keep_aspect_ratio( GTK_PICTURE(kyou), true );
|
||||||
else
|
#else
|
||||||
gtk_picture_set_content_fit(GTK_PICTURE(kyou), GTK_CONTENT_FIT_CONTAIN);
|
gtk_picture_set_content_fit(GTK_PICTURE(kyou), GTK_CONTENT_FIT_CONTAIN);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Setup event listeners */
|
/* Setup event listeners */
|
||||||
ev_key = gtk_event_controller_key_new();
|
ev_key = gtk_event_controller_key_new();
|
||||||
@@ -293,7 +300,7 @@ int main(int argc, char **argv) {
|
|||||||
"-----------------------\n" );
|
"-----------------------\n" );
|
||||||
printf( "~\e[31m羌瘣小ささ\e[0m!~\n" );
|
printf( "~\e[31m羌瘣小ささ\e[0m!~\n" );
|
||||||
|
|
||||||
app = gtk_application_new("dev.chenco.tiny-kyoukai",G_APPLICATION_DEFAULT_FLAGS);
|
app = gtk_application_new("dev.chenco.tiny-kyoukai", APP_FLAGS);
|
||||||
g_signal_connect(app, "activate", G_CALLBACK(activate), &options);
|
g_signal_connect(app, "activate", G_CALLBACK(activate), &options);
|
||||||
status = g_application_run(G_APPLICATION(app), argc, argv);
|
status = g_application_run(G_APPLICATION(app), argc, argv);
|
||||||
g_object_unref(app);
|
g_object_unref(app);
|
||||||
|
|||||||
Reference in New Issue
Block a user