This is an archive of the discontinued LLVM Phabricator instance.

Fix LLVM target triple computation with MSVC
AbandonedPublic

Authored by zturner on Jul 29 2014, 6:38 PM.

Details

Reviewers
None
Summary

CMake tries to determine the host target triple for the build by checking the value of CMAKE_CL_64. The value of this variable is tied to the CMake generator, and not the toolchain in use. In particular, it is only set to 1 when a generator of the form "Visual Studio <n> Win64" is used. This means that it doesn't work for the Ninja generator, and will always give you a host triple of i686-pc-win32 even when compiling with a 64-bit toolchain.

This patch addresses this by running ${CMAKE_CXX_COMPILER} when MSVC is detected, and parsing its output to determine the architecture that it claims it targets, and then choosing the target triple accordingly.

Diff Detail

Event Timeline

zturner updated this revision to Diff 12005.Jul 29 2014, 6:38 PM
zturner retitled this revision from to Fix LLVM target triple computation with MSVC.
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added a reviewer: chandlerc.
zturner set the repository for this revision to rL LLVM.
zturner added a subscriber: Unknown Object (MLST).
chandlerc resigned from this revision.Mar 29 2015, 12:53 PM
chandlerc removed a reviewer: chandlerc.

Assuming you'le already handled this? Put me back on if this actually still needs review.

zturner abandoned this revision.Oct 15 2015, 1:55 PM