MantisBT - CMake
View Issue Details
0014088CMakeModulespublic2013-04-15 10:432014-03-05 09:58
Jan Hudec 
Patrick R. Gansterer 
normalmajoralways
closedfixed 
 
CMake 2.8.12 
0014088: WinCE Visual Studio generators emit incorrect project if /ENTRY option is changed
I have wmain defined in some CE projects and therefore use /ENTRY:mainWCRTStartup option. But in currentl nightly it generates invalid project with two instances of the `EntryPointSymbol` option.
Set `/ENTRY` option and generate project with any Visual Studio 9 2008 Windows CE generator.
The code in http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2118a2016f69f3c7cdb711eaaa2f6ca9374103ce [^] needs to check that the `EntryPointSymbol` attribute was already written by the base class.
No tags attached.
related to 0007919closed Brad King Patch for Windows Platform files to add WinCE support with NMake 
related to 0014420closed Patrick R. Gansterer testCCompiler failed under WinCE with linker error 
diff patch-14088.diff (810) 2013-04-15 11:09
https://public.kitware.com/Bug/file/4738/*
diff patch-14088-2.diff (2,617) 2013-04-16 04:14
https://public.kitware.com/Bug/file/4739/*
Issue History
2013-04-15 10:43Jan HudecNew Issue
2013-04-15 10:44Jan HudecNote Added: 0032837
2013-04-15 10:55Brad KingRelationship addedrelated to 0007919
2013-04-15 10:55Brad KingAssigned To => Patrick R. Gansterer
2013-04-15 10:55Brad KingStatusnew => assigned
2013-04-15 11:09Jan HudecNote Added: 0032843
2013-04-15 11:09Jan HudecFile Added: patch-14088.diff
2013-04-15 11:20Patrick R. GanstererNote Added: 0032844
2013-04-16 03:31Jan HudecNote Added: 0032848
2013-04-16 03:46Jan HudecNote Added: 0032849
2013-04-16 03:53Jan HudecNote Edited: 0032849bug_revision_view_page.php?bugnote_id=32849#r1113
2013-04-16 04:14Jan HudecFile Added: patch-14088-2.diff
2013-04-16 04:15Jan HudecNote Added: 0032850
2013-08-05 15:29Patrick R. GanstererNote Added: 0033670
2013-08-06 17:22Patrick R. GanstererNote Added: 0033672
2013-08-06 17:22Patrick R. GanstererStatusassigned => resolved
2013-08-06 17:22Patrick R. GanstererResolutionopen => fixed
2013-08-06 17:22Patrick R. GanstererFixed in Version => CMake 2.8.12
2013-09-23 09:06Brad KingRelationship addedrelated to 0014420
2014-03-05 09:58Robert MaynardNote Added: 0035264
2014-03-05 09:58Robert MaynardStatusresolved => closed

Notes
(0032837)
Jan Hudec   
2013-04-15 10:44   
Related to 0007919 which introduces the code in question.
(0032843)
Jan Hudec   
2013-04-15 11:09   
A quick fix is to just ask the options object whether it knows about EntryPointSymbol before emitting it (quickly tested, works for me, patch attached). I would consider it nicer to reorder the code and set the flag into the options object instead though.
(0032844)
Patrick R. Gansterer   
2013-04-15 11:20   
1) Thanks for testing the WinCE stuff!
2) Thanks for the patch.

The "main problem" is, that the non-WinCE code does not need a EntryPointSymbol and is detected during linking. I'll try to find a nicer solution, but I don't think that the attached patch is that bad. ;-)
(0032848)
Jan Hudec   
2013-04-16 03:31   
I don't think the patch was bad either. I just feared the growing chain of ifs makes it easier to miss things.
(0032849)
Jan Hudec   
2013-04-16 03:46   
(edited on: 2013-04-16 03:53)
Hm, one more thing. The generator is able to translate `/D_UNICODE` to `CharacterSet="1"` option, which than affects the default EntryPointSymbol. The code needs to look at that option too. And it does not have to set `EntryPointSymbol` when building WIN32 executable, because WinMain/wWinMain are correctly defaulted.

(0032850)
Jan Hudec   
2013-04-16 04:15   
Attached another patch (made against clean master, not the first one) that takes CharacterSet into account. The EntryPointSymbol is only emitted for "console" applications, the default is appropriate for "windows" ones.
(0033670)
Patrick R. Gansterer   
2013-08-05 15:29   
I've pushed a solution at http://cmake.org/gitweb?p=stage/cmake.git;h=refs/heads/wince-entrypoint. [^]
(0033672)
Patrick R. Gansterer   
2013-08-06 17:22   
Merged into master: http://cmake.org/gitweb?p=cmake.git;a=commit;h=a3b86cf7117661d9b93d9ab10d5120c3bf6ccac4 [^]
(0035264)
Robert Maynard   
2014-03-05 09:58   
Closing resolved issues that have not been updated in more than 4 months