Some very interesting things are happening. I am walking through the code with
F11, F10, Shift+F10 and trying to understand what’s happening. What really
makes this process hard is that occasionally it succeeds generating the
Makefile and the exit code is 0. Ultimately if I try to run the generated
makefile it terminates with a linker error:
PS C:\Users\Matty> Import-VisualEnvironment -Version 14 -Architecture Win64
PS C:\Users\Matty> cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
PS C:\Users\Matty> cd .\Build\CMake_Example\NMake\
PS C:\Users\Matty\Build\CMake_Example\NMake> nmake clean
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Matty\Build\CMake_Example\NMake> nmake
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 20%] Building CXX object phys/CMakeFiles/Phys.dir/src/stuff.cpp.obj
stuff.cpp
[ 40%] Building CXX object phys/CMakeFiles/Phys.dir/src/more.cpp.obj
more.cpp
[ 60%] Linking CXX static library Phys.lib
[ 60%] Built target Phys
[ 80%] Building CXX object app/CMakeFiles/Application.dir/src/main.cpp.obj
main.cpp
[100%] Linking CXX executable Application.exe
[100%] Built target Application
Import-VisualEnvironment is a PowerShell Commandlet made by me which
essentially calls vcvarsall.bat.
The extra info I gained through the VERBOSE=1 env var is this:
Linking C executable cmTC_14330.exe
C:\Users\Matty\Build\CMake\VS14\bin\Debug\cmake.exe -E vs_link_exe
--intdir=CMakeFiles\cmTC_14330.dir --manifests --
C:\Kellekek\MICROS~1\VISUAL~1\14.0\VC\bin\amd64\link.exe /nologo
@CMakeFiles\cmTC_14330.dir\objects1.rsp
@C:\Users\Matty\AppData\Local\Temp\nm32CF.tmp
Visual Studio Incremental Link with embedded manifests
Create CMakeFiles\cmTC_14330.dir/manifest.rc
Create empty: CMakeFiles\cmTC_14330.dir/embed.manifest
RC Pass 1:
/foCMakeFiles\cmTC_14330.dir/manifest.res
CMakeFiles\cmTC_14330.dir/manifest.rc
RC Pass 1 failed to run.
However, this part I do not understand. I believe something is not quite
consistent within the generation process, sometimes succeeding and somethimes
not. Any ideas?
Thanks Brad for the tips thus far,
Máté
Feladó: Brad King
Elküldve: 2016. szeptember 15., csütörtök 15:11
Címzett: [email protected]
Másolatot kap: [email protected]
Tárgy: Re: [cmake-developers] Debug through config/gen inside Visual Studio
On 09/15/2016 09:04 AM, [email protected] wrote:
> That is exactly what I’m doing. I am generating a VS solution, and
> inside that I setup the debugging environment, but the process I want
> to debug is not the VS solution generation, but the NMake Makefile
> generation process.
Okay, misread your original message. I've never actually tried that.
> What should I put inside the Environment dialog to make things work?
> Even when it’s empty, it finds cl.exe, but cmake fails trying to use it.
Add "VERBOSE=1" to the environment to get a little more output about
the "RC Pass 1 failed to run" failure.
-Brad
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers