summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Bach <pascal.bach@siemens.com>2014-12-02 12:33:42 (GMT)
committerBrad King <brad.king@kitware.com>2014-12-03 14:07:11 (GMT)
commit681cda02bf656c1cc114632d60afc8bd0cac4b09 (patch)
tree7a99207d9585924609ebdf9069c3e146d0a68f81
parent433c6d4689ca86f1a8d8d966be0204e98f95b968 (diff)
downloadCMake-681cda02bf656c1cc114632d60afc8bd0cac4b09.zip
CMake-681cda02bf656c1cc114632d60afc8bd0cac4b09.tar.gz
CMake-681cda02bf656c1cc114632d60afc8bd0cac4b09.tar.bz2
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>
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 26fc317..2ef27e2 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -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