[CMake] don't build libLTO when LLVM_ENABLE_PIC is OFF
authorHans Wennborg <hans@hanshq.net>
Fri, 12 Feb 2016 19:02:39 +0000 (19:02 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 12 Feb 2016 19:02:39 +0000 (19:02 +0000)
commitf6892eda24f1666c9dbd64bdff0994b04554c681
tree43522b834bdc812522a660dd464ac406b1f6f052
parent40b369cf5a90122f1f263dc2d7d435a8476c651f
[CMake] don't build libLTO when LLVM_ENABLE_PIC is OFF

When cmake is run with -DLLVM_ENABLE_PIC=OFF, build fails while
linking shared library libLTO.so, because its dependencies are built
with -fno-PIC. More details here: https://llvm.org/bugs/show_bug.cgi?id=26484.
This diff reverts r252652 (git 9fd4377ddb83aee3c049dc8757e7771edbb8ee71),
which removed check NOT LLVM_ENABLE_PIC before disabling build for libLTO.so.

Patch by Igor Sugak!

Differential Revision: http://reviews.llvm.org/D17049

llvm-svn: 260703
llvm/tools/CMakeLists.txt