From 0ab31edc1759d1fe84d728ac635c90fb3bf61d65 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Jul 2023 02:18:51 +0200 Subject: [PATCH] Use flags required for using GTK in widgets sample As we use GTK directly in this sample, we need to use the appropriate compiler and link flags, so add them depending on the port in the makefile. --- samples/widgets/makefile.unx | 8 ++++++++ samples/widgets/widgets.bkl | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/samples/widgets/makefile.unx b/samples/widgets/makefile.unx index fc826d79d0..42ce45ec9e 100644 --- a/samples/widgets/makefile.unx +++ b/samples/widgets/makefile.unx @@ -228,6 +228,14 @@ WIDGETS_OBJECTS += widgets_native_wrapper.o widgets: widgets_native_wrapper.o endif +ifeq ($(WX_PORT),gtk2) +widgets_native.o: CXXFLAGS=$(shell pkg-config --cflags gtk+-2.0) +widgets: LDFLAGS=$(shell pkg-config --libs gtk+-2.0) +endif +ifeq ($(WX_PORT),gtk3) +widgets_native.o: CXXFLAGS=$(shell pkg-config --cflags gtk+-3.0) +widgets: LDFLAGS=$(shell pkg-config --libs gtk+-3.0) +endif # Dependencies tracking: -include ./*.d diff --git a/samples/widgets/widgets.bkl b/samples/widgets/widgets.bkl index 25da900a70..5dab8a4ab4 100644 --- a/samples/widgets/widgets.bkl +++ b/samples/widgets/widgets.bkl @@ -31,6 +31,14 @@ ifeq ($(WX_PORT),osx_cocoa) WIDGETS_OBJECTS += widgets_native_wrapper.o widgets: widgets_native_wrapper.o +endif +ifeq ($(WX_PORT),gtk2) +widgets_native.o: CXXFLAGS=$(shell pkg-config --cflags gtk+-2.0) +widgets: LDFLAGS=$(shell pkg-config --libs gtk+-2.0) +endif +ifeq ($(WX_PORT),gtk3) +widgets_native.o: CXXFLAGS=$(shell pkg-config --cflags gtk+-3.0) +widgets: LDFLAGS=$(shell pkg-config --libs gtk+-3.0) endif