OSDN Git Service

[cmake] Determine MSVC host triple correctly when cross-compiling
authorShoaib Meenai <smeenai@fb.com>
Wed, 13 Dec 2017 21:11:14 +0000 (21:11 +0000)
committerShoaib Meenai <smeenai@fb.com>
Wed, 13 Dec 2017 21:11:14 +0000 (21:11 +0000)
commit80b1dd834f55e351e57e9c17fffc1a2d16c4c6ec
treef6e53dbdd2e7316281761b90615a374fa6921bfa
parent74ccbceac1642911fb7c214c0983cc6d08798b41
[cmake] Determine MSVC host triple correctly when cross-compiling

CMAKE_CL_64 will never be set when cross-compiling with clang-cl, since
CMake relies on an actual VS environment in order to determine it.
Instead, use the size of a void pointer to determine the bit width of
the host compiler (and therefore the host triple), which works for both
native and cross compilation.

Note that, with the impending advent of Windows on AArch64, assuming
that a 64-bit host == x86_64 isn't correct either, but that's something
to be addressed in a follow-up.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320615 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/GetHostTriple.cmake