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.
This commit is contained in:
Vadim Zeitlin 2023-07-11 02:18:51 +02:00
parent 2e22666db8
commit 0ab31edc17
2 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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
</fragment>