Swift Macros: need help generating mocks that conform to protocols declared in other targets

I have protocols defined in 'interface' targets. I have separate targets for mocks. I want to use Swift Macros to generate mock classes that conform to protocols. It's imperative that the declarations of the mocks and protocols are in separate targets. Is this possible?

Interface target:

protocol SomethingDoer {
    func doSomething()
}

Mocks target:

import Interface

// I know freestanding declarations aren't allowed on the top level but that's
// besides the point of the question

#generateMock(for: SomethingDoer) // expands to the class below

final class SomethingDoerMock: SomethingDoer {
    var doSomethingCallsCount = 0

    func doSomething() {
        doSomethingCallsCount += 1
    }
}

The requirement for the protocol and mock to be in separate targets means I cannot use attached macros. I've tried my best to get this working with freestanding macros but couldn't. Is this currently possible? If so, how? Any help would be greatly appreciated

This is not currently possible because macros do not have access to type information, only the syntactic structure of the macro invocation itself (and any declaration they’re applied to). You would need to add the macro to the protocol definition itself in order to have the information needed to generate a conformance.