InjectionIII icon indicating copy to clipboard operation
InjectionIII copied to clipboard

Missing -interposable linker warning doesn't take into account xcconfig files

Open clemzio opened this issue 1 year ago • 2 comments

Hey there, thanks for building this!

This is a super minor issue but I noticed that I'm constantly getting the following warning in my console:

💉 ⚠️ Project file /Users/[redacted]/[redacted].xcodeproj does not contain the -interposable linker flag. In order to be able to inject methods of structs and final classes, please add "Other Linker Flags" -Xlinker -interposable for Debug builds only.

However I do actually set those flags but via an xcconfig instead (and the reloading works as expected).

// Hot-reloading with Inject.
OTHER_LDFLAGS = $(inherited) -Xlinker -interposable
Image

Reproduced with HotSwiftUI 1.2.0

clemzio avatar Jan 25 '25 09:01 clemzio

Ah, there isn't much I can do about that if it's in an .xcconfig. It's important people set the -interposable flag so I'd rather err on the side of reporting it.

johnno1962 avatar Jan 25 '25 10:01 johnno1962

@johnno1962 thanks for the quick answer and I totally understand your reasoning. As a potential compromise, would it make sense to have an optional way to disable this warning (and/or opt-out of the check)? Otherwise feel free to close! :-)

clemzio avatar Jan 28 '25 10:01 clemzio