[cmake-developers] [CMake 0012051]: MSVC, Linker option "/MANIFEST:NO" can not work

Mantis Bug Tracker mantis at public.kitware.com
Wed Apr 6 09:22:00 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12051 
====================================================================== 
Reported By:                Yuchen Deng
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12051
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-04-06 09:22 EDT
Last Modified:              2011-04-06 09:22 EDT
====================================================================== 
Summary:                    MSVC, Linker option "/MANIFEST:NO" can not work
Description: 
Hi, CMake Term!!
CMake is a great Build System, Many thanks for your work!!
And now I meet a question, and can't solved it by myself.
I am reading the CMake source, and find the local variable 'hasManifest' always
been true.
---
int cmake::VisualStudioLink(std::vector<std::string>& args, int type)
{
  ...

  if(hasIncremental && hasManifest)
    {
    if(verbose)
      {
      std::cout << "Visual Studio Incremental Link with embeded manifests\n";
      }
    return cmake::VisualStudioLinkIncremental(expandedArgs, type, verbose);
    }
----

Here is my CMakeLists.txt
---
project(SdkWindow)
cmake_minimum_required(VERSION 2.8)

add_definitions(-D_UNICODE -DUNICODE)
set(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} /MANIFEST:NO /OPT:REF /OPT:ICF")

aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} WIN32 ${SRC_LIST})
---

Here is the output log:

**** Build of configuration Default for project SdkWindow ****

cmd /C if not exist Build (mkdir Build && chdir Build && cmake -GNMake Makefiles
/MANIFEST:NO .. && nmake verbose=1) else chdir Build && cmake -GNMake Makefiles
.. && nmake all 
-- The C compiler identification is MSVC
-- The CXX compiler identification is MSVC
-- Check for CL compiler version
-- Check for CL compiler version - 1600
-- Check if this is a free VC compiler
-- Check if this is a free VC compiler - no
-- Check for working C compiler: D:/DengYC/LoveDEV/bin/cl.exe
-- Check for working C compiler: D:/DengYC/LoveDEV/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: D:/DengYC/LoveDEV/bin/cl.exe
-- Check for working CXX compiler: D:/DengYC/LoveDEV/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/DengYC/TestDemos/SDK/SdkWindow/Build

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

	D:\DengYC\LoveDEV\bin\cmake.exe -HD:\DengYC\TestDemos\SDK\SdkWindow
-BD:\DengYC\TestDemos\SDK\SdkWindow\Build --check-build-system
CMakeFiles\Makefile.cmake 0
	D:\DengYC\LoveDEV\bin\cmake.exe -E cmake_progress_start
D:\DengYC\TestDemos\SDK\SdkWindow\Build\CMakeFiles
D:\DengYC\TestDemos\SDK\SdkWindow\Build\CMakeFiles\progress.marks
	D:\DengYC\LoveDEV\bin\nmake.exe -f CMakeFiles\Makefile2 /nologo -              
    all
	D:\DengYC\LoveDEV\bin\nmake.exe -f CMakeFiles\SdkWindow.dir\build.make /nologo
-L                  CMakeFiles\SdkWindow.dir\depend
	D:\DengYC\LoveDEV\bin\cmake.exe -E cmake_depends "NMake Makefiles"
D:\DengYC\TestDemos\SDK\SdkWindow D:\DengYC\TestDemos\SDK\SdkWindow
D:\DengYC\TestDemos\SDK\SdkWindow\Build D:\DengYC\TestDemos\SDK\SdkWindow\Build
D:\DengYC\TestDemos\SDK\SdkWindow\Build\CMakeFiles\SdkWindow.dir\DependInfo.cmake
--color=
Dependee
"D:\DengYC\TestDemos\SDK\SdkWindow\Build\CMakeFiles\SdkWindow.dir\DependInfo.cmake"
is newer than depender
"D:/DengYC/TestDemos/SDK/SdkWindow/Build/CMakeFiles/SdkWindow.dir/depend.internal".
Dependee
"D:/DengYC/TestDemos/SDK/SdkWindow/Build/CMakeFiles/CMakeDirectoryInformation.cmake"
is newer than depender
"D:/DengYC/TestDemos/SDK/SdkWindow/Build/CMakeFiles/SdkWindow.dir/depend.internal".
Scanning dependencies of target SdkWindow
	D:\DengYC\LoveDEV\bin\nmake.exe -f CMakeFiles\SdkWindow.dir\build.make /nologo
-L                  CMakeFiles\SdkWindow.dir\build
	D:\DengYC\LoveDEV\bin\cmake.exe -E cmake_progress_report
D:\DengYC\TestDemos\SDK\SdkWindow\Build\CMakeFiles 1
[100%] Building CXX object CMakeFiles/SdkWindow.dir/WinMain.cpp.obj
	D:\DengYC\LoveDEV\bin\cl.exe  @C:\Users\ADMINI~1\AppData\Local\Temp\nmCDAC.tmp
WinMain.cpp
Linking CXX executable SdkWindow.exe
	D:\DengYC\LoveDEV\bin\cmake.exe -E vs_link_exe D:\DengYC\LoveDEV\bin\cl.exe 
/nologo @CMakeFiles\SdkWindow.dir\objects1.rsp
@C:\Users\ADMINI~1\AppData\Local\Temp\nmCF91.tmp
Visual Studio Incremental Link with embeded manifests
Create SdkWindow.exe.resource.txt
Create empty: SdkWindow.exe.embed.manifest
RC Pass 1:
D:/DengYC/LoveDEV/bin/RC.Exe /foSdkWindow.exe.embed.manifest.res
SdkWindow.exe.resource.txt 
LINK Pass 1:
D:\DengYC\LoveDEV\bin\cl.exe /nologo @CMakeFiles\SdkWindow.dir\objects1.rsp
/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
/FeSdkWindow.exe /FdD:\DengYC\TestDemos\SDK\SdkWindow\Build\SdkWindow.pdb -link
/implib:SdkWindow.lib /version:0.0 /STACK:10000000 /machine:X86 /debug
/INCREMENTAL /subsystem:windows kernel32.lib user32.lib gdi32.lib winspool.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST
/MANIFESTFILE:SdkWindow.exe.intermediate.manifest
SdkWindow.exe.embed.manifest.res 
MT:
D:/DengYC/LoveDEV/bin/mt.exe /nologo /out:SdkWindow.exe.embed.manifest
/notify_update /manifest SdkWindow.exe.intermediate.manifest 
RC Pass 2:
D:/DengYC/LoveDEV/bin/RC.Exe /foSdkWindow.exe.embed.manifest.res
SdkWindow.exe.resource.txt 
FINAL LINK:
D:\DengYC\LoveDEV\bin\cl.exe /nologo @CMakeFiles\SdkWindow.dir\objects1.rsp
/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
/FeSdkWindow.exe /FdD:\DengYC\TestDemos\SDK\SdkWindow\Build\SdkWindow.pdb -link
/implib:SdkWindow.lib /version:0.0 /STACK:10000000 /machine:X86 /debug
/INCREMENTAL /subsystem:windows kernel32.lib user32.lib gdi32.lib winspool.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST
/MANIFESTFILE:SdkWindow.exe.intermediate.manifest
SdkWindow.exe.embed.manifest.res 
	D:\DengYC\LoveDEV\bin\cmake.exe -E cmake_progress_report
D:\DengYC\TestDemos\SDK\SdkWindow\Build\CMakeFiles  1
[100%] Built target SdkWindow
	D:\DengYC\LoveDEV\bin\cmake.exe -E cmake_progress_start
D:\DengYC\TestDemos\SDK\SdkWindow\Build\CMakeFiles 0

**** Build Finished ****

---
And your can see that "/MANIFEST:NO" not work for MSVC.
My MSVC version:
---
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

I search the whole web, but can not find a way to solved this issue.
So, If your find some time, please have a look.
Many thanks!!
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-06 09:22 Yuchen Deng    New Issue                                    
======================================================================




More information about the cmake-developers mailing list