This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Multi-target builtins build
ClosedPublic

Authored by phosek on Nov 14 2016, 4:51 PM.

Details

Summary

This change enables building builtins for multiple different targets using LLVM runtimes directory.

To specify the builtin targets to be built, use the LLVM_BUILTIN_TARGETS variable, where the value is the list of targets. To pass a per target variable to the builtin build, you can set BUILTINS_<target>_<variable> where <variable> will be passed to the builtin build for <target>.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek updated this revision to Diff 77919.Nov 14 2016, 4:51 PM
phosek retitled this revision from to [CMake] Multi-target builtins build.
phosek updated this object.
phosek added a reviewer: beanz.
phosek set the repository for this revision to rL LLVM.
phosek added a subscriber: llvm-commits.

There is a related compiler-rt change D26653 and example use case D26654.

beanz edited edge metadata.Nov 15 2016, 10:12 AM
beanz added a subscriber: rengolin.

Minor comments below. Otherwise LGTM! Thank you for picking this up. I'm really excited to see this taking shape.

Looping in @rengolin because he has been interested in this in the past.

cmake/modules/LLVMExternalProjectUtils.cmake
47 ↗(On Diff #77919)

Adding llvm-ar to the default toolchain tools isn't valid on all platforms. In fact, I only think it is valid for Linux-based platforms, because it isn't for Darwin or (I think) Windows. Can you make this conditional?

74 ↗(On Diff #77919)

CMake now has if(... IN_LIST ...) that makes this simpler. I know we're not universally using it yet, but we should at least use it in new code because it is way easier to read.

phosek updated this revision to Diff 78293.Nov 16 2016, 5:18 PM
phosek edited edge metadata.
phosek marked 2 inline comments as done.

Ping, could you please take a look again?

beanz accepted this revision.Nov 28 2016, 3:03 PM
beanz edited edge metadata.

LGTM! Thank you for doing this!

This revision is now accepted and ready to land.Nov 28 2016, 3:03 PM
This revision was automatically updated to reflect the committed changes.