Skip to content

Instantly share code, notes, and snippets.

@estan
Created August 19, 2018 09:56
Show Gist options
  • Save estan/174d50023d4edeedfc3b20ddd1be876c to your computer and use it in GitHub Desktop.
Save estan/174d50023d4edeedfc3b20ddd1be876c to your computer and use it in GitHub Desktop.
CMake picking wrong (host x86) compiler instead of 64-bit native
C:\Users\Elvis\Dev\tst\build>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26726 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
C:\Users\Elvis\Dev\tst\build>type ..\CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(tst)
message("CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
add_executable(tst tst.cpp)
C:\Users\Elvis\Dev\tst\build>cmake ..
-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299.
-- The C compiler identification is MSVC 19.15.26726.0
-- The CXX compiler identification is MSVC 19.15.26726.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_SYSTEM_PROCESSOR: AMD64
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Elvis/Dev/tst/build
C:\Users\Elvis\Dev\tst\build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment