ofxAudioUnit icon indicating copy to clipboard operation
ofxAudioUnit copied to clipboard

ARC Compatibility

Open dimitre opened this issue 1 year ago • 10 comments

Hello @admsys thanks for this great addon. I'm just writing to notify OF project transitioned to ARC and next release will be out soon. Thank you

dimitre avatar Apr 30 '23 22:04 dimitre

OF 0.12.0 is out finally !

dimitre avatar Aug 31 '23 02:08 dimitre

Hi @dimitre! thanks for the nudge, I don't have a mac development system around these days unfortunately. This will have to sit for a while unless someone can open a PR for it.

admsyn avatar Sep 11 '23 21:09 admsyn

Thank you! I'll copy @2bbb and @artificiel here, in the case they have time to have a look.

dimitre avatar Sep 12 '23 13:09 dimitre

@dimitre

maybe supporting ARC is not so hard. we need to fix only ofxAudioUnitCocoaUtilties.mm.

but those codes are not regular method names or implementations of Objective-C style, about initXXX. basically methods named as initXXX need to returns instancetype (i.e. class itself). and I can't understand enough what those codes want to do actually and relations.

so, I can support to fix but I can't do by myself. sorry!

2bbb avatar Sep 13 '23 06:09 2bbb

Hi, I've found that the easiest way to support ARC and for this addon to work with OF0.12 is to add the -fno-objc-arc flag to ofxAudioUnitCocoaUtilties.mm. Check this screenshot on where to click and just paste there the -fno-objc-arc flag. compile as usual. Screen Shot 2023-12-16 at 21 09 58

roymacdonald avatar Dec 16 '23 17:12 roymacdonald

this would be a great addition to projectGenerator, if we could configure compiler flags to specific files.

dimitre avatar Dec 16 '23 17:12 dimitre

I think a generic post-processing step would be great as it allows to solve a variety of problems.

there is already a proposal for a post-compile step: https://github.com/openframeworks/projectGenerator/pull/217 perhaps a similar ADDON_AFTER_PROJECT_GENERATED that allows an addon author to script actions to be performed right after generation?

(that being said, robustly scripting modifications to xcodeproj is not a solved problem by itself, unless some new methods appeared in the past year or so?)

artificiel avatar Dec 16 '23 19:12 artificiel

@artificiel certainly it would be great, but it falls out of the scope of this. Although a post compile would not fix this issue as it is a compilation issue.

roymacdonald avatar Dec 17 '23 13:12 roymacdonald

@roymacdonald about scope maybe i misunderstood @dimitre's idea but it requires some changes to to have instructions in addon.make so PG can mark some files as no-objc-arc — my suggestion was to investigate a generic post-processing step (beyond something specific to project file attributes).

as for the reference to https://github.com/openframeworks/projectGenerator/pull/217 it was to give an example of a design that could serve as inspiration, but yeah a post-compile would not fix this issue hence my suggestion of implementing something like ADDON_AFTER_PROJECT_GENERATED

artificiel avatar Dec 17 '23 18:12 artificiel

@artificiel I get what you mean. :) I just meant that discussing any fix to the PG was out of the scope of this issue and addon. But for sure it would be great if we already had something in PG that would allow to set something in the addon_config.mk file that would allow to put those flags in it.

roymacdonald avatar Dec 17 '23 19:12 roymacdonald