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.
This commit is contained in:
Vadim Zeitlin 2023-07-11 02:09:09 +02:00
parent c9c213553a
commit 2e22666db8
3 changed files with 25 additions and 1 deletions

View file

@ -54,6 +54,7 @@ jobs:
':!build/bakefiles/make_dist.mk' \ ':!build/bakefiles/make_dist.mk' \
':!build/bakefiles/scintilla.bkl' \ ':!build/bakefiles/scintilla.bkl' \
':!docs/doxygen/doxygen-awesome-css/*' \ ':!docs/doxygen/doxygen-awesome-css/*' \
':!samples/widgets/widgets.bkl' \
':!tests/test.bkl' \ ':!tests/test.bkl' \
':!**/*akefile*' \ ':!**/*akefile*' \
':!**/*.pbxproj' \ ':!**/*.pbxproj' \

View file

@ -220,5 +220,14 @@ widgets_widgets.o: ./widgets.cpp
.PHONY: all install uninstall clean .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: # Dependencies tracking:
-include ./*.d -include ./*.d

View file

@ -13,13 +13,27 @@
--> -->
<set var="NATIVE_OBJCPP_SRC"> <set var="NATIVE_OBJCPP_SRC">
<if cond="OUT_OF_TREE_MAKEFILES=='1'"> <if cond="OUT_OF_TREE_MAKEFILES=='1'">
<!-- We can't determine if we're using Cocoa or not, assume we don't --> <!--
We can't determine if we're using Cocoa or not at generation
time, so deal with it in the makefile fragment below.
-->
</if> </if>
<if cond="TOOLKIT=='OSX_COCOA' and WXUNIV=='0'"> <if cond="TOOLKIT=='OSX_COCOA' and WXUNIV=='0'">
native_wrapper.mm native_wrapper.mm
</if> </if>
</set> </set>
<fragment format="gnu">
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
</fragment>
<exe id="widgets" template="wx_sample" template_append="wx_append"> <exe id="widgets" template="wx_sample" template_append="wx_append">
<sources> <sources>
activityindicator.cpp activityindicator.cpp