From 2e22666db89937d25eab5c6c03069de3551dd7a4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Jul 2023 02:09:09 +0200 Subject: [PATCH] Compile Cocoa control example in Unix "widgets" sample makefile Previously this was never done, as we couldn't determine if we were using Cocoa or not at generation time, but we can determine it in the makefile itself. --- .github/workflows/code_checks.yml | 1 + samples/widgets/makefile.unx | 9 +++++++++ samples/widgets/widgets.bkl | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index a7f8678be5..3538f280b1 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -54,6 +54,7 @@ jobs: ':!build/bakefiles/make_dist.mk' \ ':!build/bakefiles/scintilla.bkl' \ ':!docs/doxygen/doxygen-awesome-css/*' \ + ':!samples/widgets/widgets.bkl' \ ':!tests/test.bkl' \ ':!**/*akefile*' \ ':!**/*.pbxproj' \ diff --git a/samples/widgets/makefile.unx b/samples/widgets/makefile.unx index 4c6351e153..fc826d79d0 100644 --- a/samples/widgets/makefile.unx +++ b/samples/widgets/makefile.unx @@ -220,5 +220,14 @@ widgets_widgets.o: ./widgets.cpp .PHONY: all install uninstall clean +widgets_native_wrapper.o: ./native_wrapper.mm ./native.cpp + $(CXX) -c -o $@ $(WIDGETS_CXXFLAGS) $(OBJCXXFLAGS) ./native_wrapper.mm + +ifeq ($(WX_PORT),osx_cocoa) +WIDGETS_OBJECTS += widgets_native_wrapper.o + +widgets: widgets_native_wrapper.o +endif + # Dependencies tracking: -include ./*.d diff --git a/samples/widgets/widgets.bkl b/samples/widgets/widgets.bkl index 5c85f3aa40..25da900a70 100644 --- a/samples/widgets/widgets.bkl +++ b/samples/widgets/widgets.bkl @@ -13,13 +13,27 @@ --> - + native_wrapper.mm + +widgets_native_wrapper.o: ./native_wrapper.mm ./native.cpp + $(CXX) -c -o $@ $(WIDGETS_CXXFLAGS) $(OBJCXXFLAGS) ./native_wrapper.mm + +ifeq ($(WX_PORT),osx_cocoa) +WIDGETS_OBJECTS += widgets_native_wrapper.o + +widgets: widgets_native_wrapper.o +endif + + activityindicator.cpp