I had this same problem and it was resolved by changing the Xcode option of "compile sources as: c/objc" to "according to filetype" or just c++.
Post
Replies
Boosts
Views
Activity
https://stackoverflow.com/questions/6910901/how-do-i-print-a-list-of-build-settings-in-xcode-project/12823466#12823466
Question 2 (Slipp's answer) gives you every variable
I have the same question. I have all the code for zipping and notarizing, but it fails because the post build script runs before the signing, even if I drag the order to the end in the Build Phases.
Edit: found a solution here:
https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow?language=objc
You need to do your post build script on archive. This allows it to sign before running your script to notarize.