MantisBT - CMake
View Issue Details
0015496CMake(No Category)public2015-04-04 04:532016-06-10 14:31
Tom Deseyn 
Kitware Robot 
normalminorhave not tried
closedmoved 
 
 
0015496: VS 2013 Win64 generator adds machine:X86 link option
VS 2013 Win64 generator adds machine:X86 link option which results into a link error: 'fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86''.

When I manually remove the machine from AdditionalOptions, the project compiles fine.

I tried figuring out from the sources where the bug may originate and my guess is that "${ARCHITECTURE_ID}" in CMakeDetermineCompilerId.cmake doesn't get set to 'x64'.
CMakeCache.txt contains the following lines:
CMAKE_EXE_LINKER_FLAGS:STRING= /machine:X86
CMAKE_MODULE_LINKER_FLAGS:STRING= /machine:X86
CMAKE_SHARED_LINKER_FLAGS:STRING= /machine:X86

I am using cmake 3.2.1 on Windows 7 with VS 2013 Pro.
My project is generated using: cmake -G "Visual Studio 12 2013 Win64" .

Is there a way to force these flags to be empty or x64 so I can workaround this bug?
No tags attached.
Issue History
2015-04-04 04:53Tom DeseynNew Issue
2015-04-06 08:34Brad KingNote Added: 0038407
2015-04-06 11:34Tom DeseynNote Added: 0038451
2015-04-06 11:43Tom DeseynNote Added: 0038452
2015-04-06 11:43Brad KingNote Added: 0038453
2016-06-10 14:29Kitware RobotNote Added: 0042752
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038407)
Brad King   
2015-04-06 08:34   
It is expected that the compiler detection should determine the proper architecture to set this flag correctly. It is known to work in general, so we need to figure out what goes wrong in your case.

Look at the CMakeFiles/CMake*.log and CMakeFiles/${CMAKE_VERSION}/* files for more details.
(0038451)
Tom Deseyn   
2015-04-06 11:34   
CMakeError.log contains two lines:
The C compiler identification could not be found in "Z:/project/CMakeFiles/3.2.1/CompilerIdC/CompilerIdC.vcxproj"

The CXX compiler identification could not be found in "Z:/project/CMakeFiles/3.2.1/CompilerIdCXX/CompilerIdCXX.vcxproj"
(0038452)
Tom Deseyn   
2015-04-06 11:43   
If I open up the 'CompilerIdCXX.vcxproj' file, syntax highlighting suggests this to be the case:
# elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86"
(0038453)
Brad King   
2015-04-06 11:43   
Re 0015496:0038451: Okay. Please attach a .zip or .tgz file with the CMakeFiles directory content so I can try to diagnose the failure.
(0042752)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.