[cmake] Make linker detection take flags into account
authorShoaib Meenai <smeenai@fb.com>
Thu, 26 Apr 2018 06:04:46 +0000 (06:04 +0000)
committerShoaib Meenai <smeenai@fb.com>
Thu, 26 Apr 2018 06:04:46 +0000 (06:04 +0000)
commitfd7befad239bdbd153bc860c6e793abc7081dfbe
tree49de34016990f227f3097ba8dc36705ac9ca21e1
parente95bde33df0e8d92a7a70ad912f4d00aa44ae842
[cmake] Make linker detection take flags into account

LLVM might be compiled using a toolchain file which controls the linker
to use via flags (e.g. `-B` or `-fuse-ld=`). Take these flags into
account for linker detection. We can also correct the detection by
manually passing LLVM_USE_LINKER, of course, but it seems more
convenient to have the detection take flags into account.

Differential Revision: https://reviews.llvm.org/D45464

llvm-svn: 330924
llvm/cmake/modules/AddLLVM.cmake