[CMake] Building a Windows project in both 32- and 64-bit mode using the nmake generator.
Rick McGuire
object.rexx at gmail.com
Thu May 1 09:04:59 EDT 2014
We're trying to convert a project from using a very old hand-built makefile
(the original version was written over 20 years ago!) to using cmake. We
want to do the builds using command line nmake, not using Visual Studio
project files.
With our existing setup, to switch between 32- and 64- bit builds, we only
need to change the option specified on the vcvarsall batch file and do a
clean build. The tools figure out from the environment variables which
build we're doing any everything works great.
We've started our conversion by converting one of our smaller library
files. All of the source files appear to compile correctly, but when we
get to the link, we're getting the following error:
Linking CXX shared library CMakeFiles\bin\rexxapi.dll
msvcprtd.lib(MSVCP120D.dll) : fatal error LNK1112: module machine type
'x64' con
flicts with target machine type 'X86'
LINK Pass 1 failed. with 1112
NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake
2.8\bin\cmake.exe"' :
return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
12.0
\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
12.0
\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
looking at the generated build.make file, I see that the option
/machine:X86 appears on the link command. I tried manually deleting that
option, but the error persisted. What do I need to do for cmake to
generate the correct 64-bit logic...and equally as important, how do we
switch between doing 32-bit and 64-bit builds when needed?
And let me repeat, we do not want to use the Visual Studio generators...we
want the nmake version.
Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140501/4d857af3/attachment.html>
More information about the CMake
mailing list