[CMake] Explicitly add --target option to compiler flags
authorChris Bieneman <beanz@apple.com>
Tue, 20 Sep 2016 21:36:30 +0000 (21:36 +0000)
committerChris Bieneman <beanz@apple.com>
Tue, 20 Sep 2016 21:36:30 +0000 (21:36 +0000)
commit807c0ae56966984f713293e0a7eed3ca26f9602b
tree863561dfd7cc237bcc30802312ebae6d72b81d0a
parent8cd7de1d1890d9ade06418694ebf2de9dda20d9d
[CMake] Explicitly add --target option to compiler flags

Summary:
Much of the non-Darwin build system assumes that COMPILER_RT_DEFAULT_TARGET_TRIPLE is the default target triple for the compiler being used. With clang as your compiler this isn't necessarily true.

To ensure that the rest of the build system behaves as expected this patch adds "--target=${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" to the compiler flags for C, CXX and ASM sources.

Reviewers: compnerd, rengolin, fjricci

Subscribers: llvm-commits

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

llvm-svn: 282024
compiler-rt/cmake/Modules/CompilerRTUtils.cmake