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:
Pascal Bach authored and Brad King committed 2014-12-03 09:07:11 -05:00
1 parent 433c6d4689
commit 681cda02bf
1 file changed
+16 -2
+16 -2
View File
@@ -2267,7 +2267,14 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
linkOptions.AddFlag("SubSystem", "WindowsCE");
if (this->Target->GetType() == cmTarget::EXECUTABLE)
{
linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup");
if (this->ClOptions[config]->UsingUnicode())
{
linkOptions.AddFlag("EntryPointSymbol", "wWinMainCRTStartup");
}
else
{
linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup");
}
}
}
else
@@ -2282,7 +2289,14 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
linkOptions.AddFlag("SubSystem", "WindowsCE");
if (this->Target->GetType() == cmTarget::EXECUTABLE)
{
linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup");
if (this->ClOptions[config]->UsingUnicode())
{
linkOptions.AddFlag("EntryPointSymbol", "mainWCRTStartup");
}
else
{
linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup");
}
}
}
else