love
love copied to clipboard
Can't cross-build for Linux without Objective C++ toolchain
Original report by IoriBranford (Bitbucket: IoriBranford, GitHub: IoriBranford).
I'm cross-building LOVE for armhf (Raspberry Pi) using Buildroot with Linaro 2017.11 toolchain.
Everything compiles OK, but when linking to make the executable, it wants to use the Objective C++ compiler even though I'm not building OSX or iOS and can't find any use of Obj-C++ code in the build. Linaro provides only C/C++ binaries, so in my case it falls back to the host machine's Obj-C++ which is not armhf, and thus the cross-build breaks.
From src/Makefile.in - note OBJCXX when it should be CXX:
love_LINK = $(LIBTOOL) $(AM_V_lt) $(love_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
love$(EXEEXT): $(love_OBJECTS) $(love_DEPENDENCIES) $(EXTRA_love_DEPENDENCIES)
@rm -f love$(EXEEXT)
$(AM_V_OBJCXXLD)$(love_LINK) $(love_OBJECTS) $(love_LDADD) $(LIBS)
Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).
It does say OBJCXX on purpose, to support macos builds, but I should probably only use it when there's actual objective-c++ code to compile.
I believe this is no longer an issue in love 12 now, with its CMake build system for Linux.