View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009613CMakeCMakepublic2009-09-28 19:452009-09-29 16:45
ReporterVladislav Vaintroub 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0009613: VS2010 generator seems to ignore link_flags and module definition files (.DEFs)
DescriptionVS2010 generator seems to ignore link_flags and export definition files.

With below CMakeLists.txt, I'd expect to see /DEF:foo.def /INCREMENTAL:NO in the resulting linker flags. but it is not the case.


ADD_EXECUTABLE(main main.c foo.def)
SET_TARGET_PROPERTIES(main PROPERTIES ENABLE_EXPORTS ON)
SET_TARGET_PROPERTIES(main PROPERTIES LINK_FLAGS "/INCREMENTAL:NO")
TagsNo tags attached.
Attached Files

 Relationships
related to 0009997closedBrad King .def files are not passed to the mingw linker 

  Notes
(0017813)
Bill Hoffman (manager)
2009-09-28 21:19

OK, I fixed the incremental LINK_FLAG part with this commit:

cvs commit -m "Make sure LINK_FLAGS are seen by generator, fix for part of bug#9613" cmVisualStudio10TargetGenerator.cxx
Committer: Bill Hoffman <bill.hoffman@kitware.com>
/cvsroot/CMake/CMake/Source/cmVisualStudio10TargetGenerator.cxx,v <-- cmVisualStudio10TargetGenerator.cxx
new revision: 1.17; previous revision: 1.16
(0017833)
Brad King (manager)
2009-09-29 16:44

There were a series of problems related to this bug.

------------------------------------------------------------------------------
1.) The VS 10 flag table did not have an entry for /DEF:<file>. Fixed by commit:

Add StringProperty options for VS 10 flag table
/cvsroot/CMake/CMake/Source/cmVS10CLFlagTable.h,v <-- Source/cmVS10CLFlagTable.h
new revision: 1.4; previous revision: 1.3
/cvsroot/CMake/CMake/Source/cmVS10LibFlagTable.h,v <-- Source/cmVS10LibFlagTable.h
new revision: 1.3; previous revision: 1.2
/cvsroot/CMake/CMake/Source/cmVS10LinkFlagTable.h,v <-- Source/cmVS10LinkFlagTable.h
new revision: 1.3; previous revision: 1.2

------------------------------------------------------------------------------
2.) The VS 10 flag parser was treating /DEF:<file> as a preprocessor
    option (/D) and dropping it. Fixed by commit:

Do not parse preprocessor defs for VS 10 link/lib
/cvsroot/CMake/CMake/Source/cmVisualStudio10TargetGenerator.cxx,v <-- Source/cmVisualStudio10TargetGenerator.cxx
new revision: 1.18; previous revision: 1.17

------------------------------------------------------------------------------
3.) No generator ever supported .def files for executables...only
    shared libraries. Fixed by commit:

Fix use of module .def files for MS tools
/cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v <-- Source/cmLocalVisualStudio7Generator.cxx
new revision: 1.255; previous revision: 1.254
/cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v <-- Source/cmLocalVisualStudio7Generator.h
new revision: 1.61; previous revision: 1.60
/cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v <-- Source/cmMakefileExecutableTargetGenerator.cxx
new revision: 1.64; previous revision: 1.63
/cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v <-- Source/cmMakefileLibraryTargetGenerator.cxx
new revision: 1.80; previous revision: 1.79
/cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v <-- Source/cmMakefileTargetGenerator.cxx
new revision: 1.124; previous revision: 1.123
/cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.h,v <-- Source/cmMakefileTargetGenerator.h
new revision: 1.33; previous revision: 1.32
/cvsroot/CMake/CMake/Source/cmVisualStudio10TargetGenerator.cxx,v <-- Source/cmVisualStudio10TargetGenerator.cxx
new revision: 1.19; previous revision: 1.18

------------------------------------------------------------------------------
4.) All of the above were because there was never a test for this feature. Fixed:

Test use of module .def files for MS tools
/cvsroot/CMake/CMake/Tests/CMakeLists.txt,v <-- Tests/CMakeLists.txt
new revision: 1.119; previous revision: 1.118
/cvsroot/CMake/CMake/Tests/ModuleDefinition/CMakeLists.txt,v <-- Tests/ModuleDefinition/CMakeLists.txt
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/ModuleDefinition/example_dll.c,v <-- Tests/ModuleDefinition/example_dll.c
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/ModuleDefinition/example_dll.def,v <-- Tests/ModuleDefinition/example_dll.def
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/ModuleDefinition/example_dll_2.c,v <-- Tests/ModuleDefinition/example_dll_2.c
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/ModuleDefinition/example_dll_2.def,v <-- Tests/ModuleDefinition/example_dll_2.def
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/ModuleDefinition/example_exe.c,v <-- Tests/ModuleDefinition/example_exe.c
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/ModuleDefinition/example_exe.def,v <-- Tests/ModuleDefinition/example_exe.def
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/ModuleDefinition/example_mod_1.c,v <-- Tests/ModuleDefinition/example_mod_1.c
initial revision: 1.1
(0017834)
Brad King (manager)
2009-09-29 16:45

We'll include these changes in the next 2.8.0 release candidate.

 Issue History
Date Modified Username Field Change
2009-09-28 19:45 Vladislav Vaintroub New Issue
2009-09-28 20:01 Bill Hoffman Status new => assigned
2009-09-28 20:01 Bill Hoffman Assigned To => Brad King
2009-09-28 21:19 Bill Hoffman Note Added: 0017813
2009-09-29 16:44 Brad King Note Added: 0017833
2009-09-29 16:45 Brad King Note Added: 0017834
2009-09-29 16:45 Brad King Status assigned => closed
2009-09-29 16:45 Brad King Resolution open => fixed
2011-02-21 14:51 Brad King Relationship added related to 0009997


Copyright © 2000 - 2018 MantisBT Team