MantisBT - CMake
View Issue Details
0011122CMakeCMakepublic2010-08-12 11:192016-06-10 14:31
Kevin Fitch 
Kitware Robot 
normalminorhave not tried
closedmoved 
CMake-2-8 
 
0011122: VS6 generator can't handle compiling the same file multiple times
I have a weird case where the same file is compiled multiple times, with different preprocessor defines, and the different results are put into different libraries. With the nmake generator I get the correct results, using VS6 generator I get incorrect results. I am not 100% certain, but this may be a fundamental limitation of VS6. I have included an example where this happens. I am using the preprocessor define to create a function name so that it will be easier to see the problem. i.e. the problem occurs at link time instead of run time.

In my example, there is one file (ketchup.c) that should generate two different ketchup.obj files, but there is only one file, and it looks like VS6 just skips compiling it the second time.

I haven't tried with my toy example here, but newer VS generators seem to handle this OK.
No tags attached.
zip badVS6.zip (735) 2010-08-12 11:21
https://public.kitware.com/Bug/file/3314/badVS6.zip
Issue History
2010-08-12 11:19Kevin FitchNew Issue
2010-08-12 11:21Kevin FitchFile Added: badVS6.zip
2010-12-15 11:20David ColeNote Added: 0024159
2010-12-15 11:20David ColeAssigned To => David Cole
2010-12-15 11:20David ColeStatusnew => assigned
2011-02-09 14:26David ColeStatusassigned => backlog
2011-02-09 15:06David ColeAssigned ToDavid Cole =>
2016-06-10 14:28Kitware RobotNote Added: 0041737
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0024159)
David Cole   
2010-12-15 11:20   
Workaround suggestion: make a new *.c file with a new name, with contents:
#include "ketchup.c"

Then you'll have two uniquely named files, and VS6 support works for you without waiting for a CMake bug fix.

In fact, since there is what I would consider an easy work-around, I'd be inclined to simply resolve this one as "won't fix."
(0041737)
Kitware Robot   
2016-06-10 14:28   
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.