SwiftPM binaryTarget dependency and code signing

I'm seeing the same issue with codesigning in Xcode 13.0 RC.

I've implemented the following workaround in my project that seems to get around the missing code signing. Interestingly, this is only an issue when building on my Intel Mac - my Apple Silicon Mac builds just fine.

If you want to use this workaround, add the following as an Xcode Build Phase in your affected targets. I had to add it to my application and test targets.

# Populate a variable with the current code signing identity if it's available in the environment.
SIGNING_IDENTITY="${EXPANDED_CODE_SIGN_IDENTITY:-$CODE_SIGN_IDENTITY}"

# Populate a variable with the current code signing flags and options in the environment.
OTHER_CODE_SIGN_FLAGS=${OTHER_CODE_SIGN_FLAGS:-}
 
# Re-sign the SwiftPM packaged frameworks using the application's details.
if [ -n "${SIGNING_IDENTITY}" ]; then
    find "${CONFIGURATION_BUILD_DIR}/PackageFrameworks" \
        -name "*.framework" \
        -type d \
        -exec codesign ${OTHER_CODE_SIGN_FLAGS} \
            --force \
            --sign "${SIGNING_IDENTITY}" \
            --options runtime \
            --deep \
            {} \;
fi