This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Fix builds with LLVM_ENABLE_PIC=0
ClosedPublic

Authored by labath on Jun 1 2016, 3:34 PM.

Details

Summary

When this flag is specified, the target llvm-lto is not built, but is still
used as a dependency of the test targets. cmake 2.8 silently ignored this
situation, but with cmake_minimum_required(3.4) it becomes an error. Fix this
by avoiding the inclusion the target as a dependency.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 59293.Jun 1 2016, 3:34 PM
labath retitled this revision from to [cmake] Fix builds with LLVM_ENABLE_PIC=0.
labath updated this object.
labath added a reviewer: beanz.
labath added a subscriber: cfe-commits.
beanz accepted this revision.Jun 2 2016, 9:25 AM
beanz edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jun 2 2016, 9:25 AM
This revision was automatically updated to reflect the committed changes.
chapuni added a subscriber: chapuni.Jun 2 2016, 2:01 PM

Have you tested if it might work? In fact, it didn't work.

cfe/trunk/test/CMakeLists.txt
78

llvm-lto was not processed before clang. Fixed in r271585.

83

It would be redundant unless libLTO.so were actually used in tests.