[cmake-developers] [PATCH] VS, WINCE: Fix entry point for Unicode builds
Bach, Pascal
pascal.bach at siemens.com
Tue Dec 9 09:45:48 EST 2014
> Fixed typo in commit message:
>
> VS, WINCE: Fix entry point for Unicode builds
> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=681cda02
>
I figured out that the combination /ENTRY:mainCRTStartup is also possible even if UNICODE is enabled.
The question is now what should CMake do as default.
1) With the patch applied the behavior is as follows: The default entry points are mainCRTStartup (non Unicode) and mainWCRTStartup (for Unicode). So this means as soon as "UNICODE" is set the default Visual Studio is looking for wmain instead of main. If the user wants to change back to main he has to do something like this: set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:mainCRTStartup" )
2) Without my patch: The default entry point is mainCRTStartup (for both non Unicode and Unicode). So if UNICODE is set this doesn't change anything. If the user wants to use wmain he has to do something like this: set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ENTRY:mainWCRTStartup" )
I'm not sure what is better. I almost think the old behavior was better. The user should then be able to set the entry point independent of the UNICODE setting via a target property. This would be similar to how WIN32_EXECUTABLE selects WinMain as startup.
Any thoughts on this?
Pascal
More information about the cmake-developers
mailing list