summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Gansterer <paroga@paroga.com>2012-11-20 11:38:06 (GMT)
committerBrad King <brad.king@kitware.com>2012-11-26 14:33:28 (GMT)
commit2118a2016f69f3c7cdb711eaaa2f6ca9374103ce (patch)
treeabbc539a5ce34a0ea53d053bbb246a5650470d85
parent6920fed652339ca6b45d98769c88a8c341e507b8 (diff)
downloadCMake-2118a2016f69f3c7cdb711eaaa2f6ca9374103ce.zip
CMake-2118a2016f69f3c7cdb711eaaa2f6ca9374103ce.tar.gz
CMake-2118a2016f69f3c7cdb711eaaa2f6ca9374103ce.tar.bz2
VS: Support setting correct subsystem and entry point for WinCE
WinCE has only one SubSystem. So the WIN32_EXECUTABLE property must be handled via the EntryPointSymbol in the vcproj files.
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h3
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx20
-rw-r--r--Source/cmLocalVisualStudio7Generator.h1
3 files changed, 21 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index f9715ab..9d81170 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -72,6 +72,9 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig() { return true; }
+ /** Return true if building for Windows CE */
+ virtual bool TargetsWindowsCE() const { return false; }
+
class TargetSet: public std::set<cmTarget*> {};
struct TargetCompare
{
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index d954a52..665ef3b 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -229,6 +229,9 @@ void cmLocalVisualStudio7Generator
this->FortranProject =
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
->TargetIsFortranOnly(target);
+ this->WindowsCEProject =
+ static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
+ ->TargetsWindowsCE();
// Intel Fortran for VS10 uses VS9 format ".vfproj" files.
VSVersion realVersion = this->Version;
@@ -1173,6 +1176,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
cmComputeLinkInformation& cli = *pcli;
const char* linkLanguage = cli.GetLinkLanguage();
+ bool isWin32Executable = target.GetPropertyAsBool("WIN32_EXECUTABLE");
+
// Compute the variable name to lookup standard libraries for this
// language.
std::string standardLibsVar = "CMAKE_";
@@ -1220,15 +1225,24 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
{
fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n";
}
- if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") )
+ if ( this->WindowsCEProject )
+ {
+ fout << "\t\t\t\tSubSystem=\"9\"\n"
+ << "\t\t\t\tEntryPointSymbol=\""
+ << (isWin32Executable ? "WinMainCRTStartup" : "mainACRTStartup")
+ << "\"\n";
+ }
+ else if ( this->FortranProject )
{
fout << "\t\t\t\tSubSystem=\""
- << (this->FortranProject? "subSystemWindows" : "2") << "\"\n";
+ << (isWin32Executable ? "subSystemWindows" : "subSystemConsole")
+ << "\"\n";
}
else
{
fout << "\t\t\t\tSubSystem=\""
- << (this->FortranProject? "subSystemConsole" : "1") << "\"\n";
+ << (isWin32Executable ? "2" : "1")
+ << "\"\n";
}
std::string stackVar = "CMAKE_";
stackVar += linkLanguage;
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 95db2cc..5a1d208 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -122,6 +122,7 @@ private:
cmVS7FlagTable const* ExtraFlagTable;
std::string ModuleDefinitionFile;
bool FortranProject;
+ bool WindowsCEProject;
std::string PlatformName; // Win32 or x64
cmLocalVisualStudio7GeneratorInternals* Internal;
};