title: How to codesign and enable the hardened runtime for a 3rd-party CLI on Xcode?
body: <p>My project needs the Ghostscript to do lots of tasks, so I have added the gs CLI tool into my project resource. However when I tried to notarize the project application, Xcode shows me this:</p>
  
  <p><a href="https://i.stack.imgur.com/5N7jc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5N7jc.png" alt="enter image description here"></a></p>
  
  <p>I assume that might because the ghostscript portable CLI is a 3rd-party program from the internet and which doesn't have a codesign, also it has not been enabled the hardened runtime. On the latest MacOS Mojave I have to notarize applications to avoid the gatekeeper shows warnings during the user opens the DMG file. But it seems the notarizing is hard to pass if the application contains a 3rd-party CLI.</p>
  
  <p>Is there a solution for this?</p>