[PATCH] D53073: With CMake 3.8+ force Visual Studio generator builds to use the x64 host toolchain if the user is on a 64-bit system

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 12 07:37:45 PDT 2018


aaron.ballman added a comment.

This area of CMake is pretty mysterious to me, but the behavior seems to be... different than what I'd expect. I'm using CMake 3.10.2.

  With Patch and without -Thost=x64
  CMAKE
  -- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe -- works
  
  Process Explorer
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.15.26726\bin\Hostx86\x64\cl.exe
  
  Without Patch and with -Thost=x64
  CMAKE
  -- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64/cl.exe -- works
  
  Process Explorer
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64\cl.exe

So with the patch and when not using -Thost=x64, CMake finds the compiler at `Hostx64/x64/cl.exe` but MSBuild executes `Hostx86\x64\cl.exe` and without the patch when using -Thost=x64, CMake finds the compiler at `Hostx64/x64/cl.exe` and MSBuild executes the compiler at `Hostx64\x64\cl.exe`.


https://reviews.llvm.org/D53073





More information about the llvm-commits mailing list