View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015603CMakeCMakepublic2015-06-03 13:462016-01-04 11:51
ReporterJan Ciger 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformWindows 7OSWindows 7 64bitOS VersionFamily ed
Product VersionCMake 3.2.2 
Target VersionFixed in Version 
Summary0015603: CMake ignores the configured Visual C/C++ compiler
DescriptionCMake Visual Studio 2013 generators (probably other versions too, but not tested) will select incorrect architecture, regardless whether or not "vcvarsall.bat amd64" was executed beforehand.

cmake . (with no generator specified) will configure 32bit build
cmake -G "Visual Studio 12 2013" will still configure only a 32bit build (the only VS 2013 generator listed in the --help output)

On the other hand
cmake-gui offers 3 (!) generators:
"Visual Studio 12 2013" (probably 32bit build?)
"Visual Studio 12 2013 Win32" (32bit build)
"Visual Studio 12 2013 Win64" (64bit build)

with the 64bit build being the default.

This behaviour is rather inconsistent:

* Both tools should be offering the same generators
* The tools should offer the correct, currently configured toolchain because otherwise all kinds of issues happen due to the Microsoft's tools being misconfigured.

The Microsoft batch files set the following env variables that can be used to identify the current setup:

64bit tools targetting 64bit native build
@set Platform=X64
@set CommandPromptType=Native

64bit tools cross-compiling for 32bit
@set Platform=X86
@set CommandPromptType=Cross
@set PreferredToolArchitecture=x64

64bit tools cross-compiling for ARM
@set Platform=ARM
@set CommandPromptType=Cross
@set PreferredToolArchitecture=x64

etc.


TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0038879)
Brad King (manager)
2015-06-03 14:34

The command line environment is not meaningful to the VS generators. You can specify the generator name on the command line with

 -G "Visual Studio 12 2013 Win64"

See 0015422 for addition of documentation of this.

(0038880)
Jan Ciger (reporter)
2015-06-03 16:45

Is documenting this actually a sufficient solution?

Running Microsoft's compilers with options that are not appropriate/in conflict to whatever was configured using their batch file results in undefined behaviour - typically libraries that cause odd crashes or refuse to link - hard to trace issues.

A more sensible thing to do would be to either warn the user or to disable the irrelevant generators.
(0040058)
Robert Maynard (manager)
2016-01-04 11:51

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-06-03 13:46 Jan Ciger New Issue
2015-06-03 14:34 Brad King Note Added: 0038879
2015-06-03 14:34 Brad King Status new => resolved
2015-06-03 14:34 Brad King Resolution open => no change required
2015-06-03 16:45 Jan Ciger Note Added: 0038880
2016-01-04 11:51 Robert Maynard Note Added: 0040058
2016-01-04 11:51 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team