Skip to content

Commit 48d4ed6

Browse files
committed
Compile AU sources with -ObjC++
DPF's DistrhoPluginAU.cpp uses Objective-C++ syntax (NSString, [obj method] sends, @Class) despite the .cpp extension, and DistrhoUIMain.cpp transitively pulls in DistrhoUIAU.mm when built with -DDISTRHO_PLUGIN_TARGET_AU. Both fail to compile as plain C++ on macOS the moment they hit <Foundation/Foundation.h>. Add target-specific BUILD_CXX_FLAGS += -ObjC++ for the two _AU.cpp.o targets. Target-specific augmentation, not modification of the generic pattern rule, so the _VST2 / _VST3 / _CLAP / _LV2 / _JACK variants keep being compiled as plain C++. Matches upstream Makefile.plugins.mk:601,605.
1 parent 7c6373b commit 48d4ed6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

plugin/dpf/Makefile.plugins.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,16 @@ $(BUILD_DIR)/DistrhoUIMain_%.cpp.o: $(DPF_PATH)/distrho/DistrhoUIMain.cpp
231231
@echo "Compiling DistrhoUIMain.cpp ($*)"
232232
@$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_PLUGIN_TARGET_$* -c -o $@
233233

234+
# The AU variants of DistrhoPluginMain.cpp and DistrhoUIMain.cpp pull in
235+
# DistrhoPluginAU.cpp / DistrhoUIAU.mm which contain Objective-C++ code
236+
# (NSString, [obj method] syntax, @class). Compile them with -ObjC++ so
237+
# clang treats them as Objective-C++ regardless of the .cpp extension.
238+
# Target-specific BUILD_CXX_FLAGS additions take effect only for these
239+
# two specific .o targets; the generic _% pattern rule above sees the
240+
# augmented flags when it expands for $*=AU.
241+
$(BUILD_DIR)/DistrhoPluginMain_AU.cpp.o: BUILD_CXX_FLAGS += -ObjC++
242+
$(BUILD_DIR)/DistrhoUIMain_AU.cpp.o: BUILD_CXX_FLAGS += -ObjC++
243+
234244
$(BUILD_DIR)/DistrhoUI_macOS_%.mm.o: $(DPF_PATH)/distrho/DistrhoUI_macOS.mm
235245
-@mkdir -p $(BUILD_DIR)
236246
@echo "Compiling DistrhoUI_macOS.mm ($*)"

0 commit comments

Comments
 (0)