This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Teach the build system to codesign built products
ClosedPublic

Authored by bogner on Jun 29 2018, 3:14 PM.

Details

Reviewers
beanz
Summary

Automatically codesign all executables and dynamic libraries if a
codesigning identity is given (via LLVM_CODESIGNING_IDENTITY). This
option is darwin only for now.

Also update platforms/iOS.cmake to pick up the right versions of
codesign and codesign_allocate.

Diff Detail

Event Timeline

bogner created this revision.Jun 29 2018, 3:14 PM
bogner updated this revision to Diff 154697.Jul 9 2018, 2:35 PM
bogner edited the summary of this revision. (Show Details)

Update to set path to codesign_allocate correctly and set the extra tool paths in platforms/iOS.cmake.

beanz accepted this revision.Jul 10 2018, 10:33 AM
beanz added subscribers: JDevlieghere, davide.

Looping in @davide and @JDevlieghere. LLDB has some hand-rolled goop in debug server's build that could potentially be replaced by this.

LGTM!

This revision is now accepted and ready to land.Jul 10 2018, 10:33 AM
bogner closed this revision.Jul 10 2018, 10:38 AM

Committed in r336708.

Stefan (in our group) is going to look at CMake'y stuffs so I'm going to cc: him (he doesn't have a Phabricator account yet, so I just forwarded this e-mail to him for now).
Thanks for keeping us in the loop.

sgraenitz added inline comments.Nov 8 2018, 3:47 AM
cmake/modules/AddLLVM.cmake
1603

I am way too late with this, but shouldn't it be set(CMAKE_CODESIGN "xcrun codesign") to avoid getting a list "xcrun;codesign"?

sgraenitz added inline comments.Nov 8 2018, 5:09 AM
cmake/modules/AddLLVM.cmake
1603

Oh ok, the implementation is correct. Getting a list seems to be the preferable behaviour here. (https://stackoverflow.com/questions/8925396)