This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Obtain LLVM_CMAKE_PATH from llvm-config if available
ClosedPublic

Authored by mgorny on Nov 20 2016, 3:03 PM.

Details

Summary

Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from
llvm-config. Fallback to local reconstruction if llvm-config does not
support this option.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny updated this revision to Diff 78672.Nov 20 2016, 3:03 PM
mgorny retitled this revision from to [cmake] Obtain LLVM_CMAKE_PATH from llvm-config.
mgorny updated this object.
mgorny added reviewers: beanz, rnk, chapuni, chandlerc.
mgorny added a subscriber: cfe-commits.

Little ping here. This is quite trivial, and since D26894 has been committed already I'd like to start adding changes like this one to all LLVM projects using llvm-config in stand-alone build.

EricWF edited edge metadata.Jan 6 2017, 2:22 PM

Is there a way to write this patch so that old llvm-config's continue to work, at least for a little while until everybody upgrades?

mgorny added a comment.Jan 6 2017, 2:31 PM

Is there a way to write this patch so that old llvm-config's continue to work, at least for a little while until everybody upgrades?

Technically it's possible but I think it would add a lot of complexity. So if you believe that to be a major issue, I'd rather just wait a few days before applying the change. However, I don't think we really have a big market for people doing stand-alone builds ;-).

mgorny updated this revision to Diff 83527.Jan 7 2017, 8:12 AM
mgorny retitled this revision from [cmake] Obtain LLVM_CMAKE_PATH from llvm-config to [cmake] Obtain LLVM_CMAKE_PATH from llvm-config if available.
mgorny updated this object.
mgorny edited edge metadata.

Updated to support fallback to hardcoded path.

rnk accepted this revision.Jan 9 2017, 1:42 PM
rnk edited edge metadata.

lgtm I figure we've waited a few days at this point.

This revision is now accepted and ready to land.Jan 9 2017, 1:42 PM
mgorny added a comment.Jan 9 2017, 3:16 PM

As discussed on IRC, I will commit the unconditional versions for projects that require the same version of LLVM (clang, lldb, lld) and the version with fallback for others (runtimes).

This revision was automatically updated to reflect the committed changes.