VS, WINCE: Fix entry point for Unicode builds
When _UNICODE is defined VS uses wmain instead of main as the entry function. To make this correctly work on WindowsCE EntryPointSymbol needs to be set to mainWCRTStartup instead of mainACRTStartup for console applications and to wWinMainCRTStartup instead of WinMainCRTStartup for GUI applications. Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
This commit is contained in:
parent
433c6d4689
commit
681cda02bf
|
@ -2266,10 +2266,17 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
|
|||
{
|
||||
linkOptions.AddFlag("SubSystem", "WindowsCE");
|
||||
if (this->Target->GetType() == cmTarget::EXECUTABLE)
|
||||
{
|
||||
if (this->ClOptions[config]->UsingUnicode())
|
||||
{
|
||||
linkOptions.AddFlag("EntryPointSymbol", "wWinMainCRTStartup");
|
||||
}
|
||||
else
|
||||
{
|
||||
linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
linkOptions.AddFlag("SubSystem", "Windows");
|
||||
|
@ -2281,10 +2288,17 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
|
|||
{
|
||||
linkOptions.AddFlag("SubSystem", "WindowsCE");
|
||||
if (this->Target->GetType() == cmTarget::EXECUTABLE)
|
||||
{
|
||||
if (this->ClOptions[config]->UsingUnicode())
|
||||
{
|
||||
linkOptions.AddFlag("EntryPointSymbol", "mainWCRTStartup");
|
||||
}
|
||||
else
|
||||
{
|
||||
linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
linkOptions.AddFlag("SubSystem", "Console");
|
||||
|
|
Loading…
Reference in New Issue