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.
This commit is contained in:
parent
6920fed652
commit
2118a2016f
|
@ -72,6 +72,9 @@ public:
|
||||||
i.e. "Can I build Debug and Release in the same tree?" */
|
i.e. "Can I build Debug and Release in the same tree?" */
|
||||||
virtual bool IsMultiConfig() { return true; }
|
virtual bool IsMultiConfig() { return true; }
|
||||||
|
|
||||||
|
/** Return true if building for Windows CE */
|
||||||
|
virtual bool TargetsWindowsCE() const { return false; }
|
||||||
|
|
||||||
class TargetSet: public std::set<cmTarget*> {};
|
class TargetSet: public std::set<cmTarget*> {};
|
||||||
struct TargetCompare
|
struct TargetCompare
|
||||||
{
|
{
|
||||||
|
|
|
@ -229,6 +229,9 @@ void cmLocalVisualStudio7Generator
|
||||||
this->FortranProject =
|
this->FortranProject =
|
||||||
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
|
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
|
||||||
->TargetIsFortranOnly(target);
|
->TargetIsFortranOnly(target);
|
||||||
|
this->WindowsCEProject =
|
||||||
|
static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
|
||||||
|
->TargetsWindowsCE();
|
||||||
|
|
||||||
// Intel Fortran for VS10 uses VS9 format ".vfproj" files.
|
// Intel Fortran for VS10 uses VS9 format ".vfproj" files.
|
||||||
VSVersion realVersion = this->Version;
|
VSVersion realVersion = this->Version;
|
||||||
|
@ -1173,6 +1176,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
||||||
cmComputeLinkInformation& cli = *pcli;
|
cmComputeLinkInformation& cli = *pcli;
|
||||||
const char* linkLanguage = cli.GetLinkLanguage();
|
const char* linkLanguage = cli.GetLinkLanguage();
|
||||||
|
|
||||||
|
bool isWin32Executable = target.GetPropertyAsBool("WIN32_EXECUTABLE");
|
||||||
|
|
||||||
// Compute the variable name to lookup standard libraries for this
|
// Compute the variable name to lookup standard libraries for this
|
||||||
// language.
|
// language.
|
||||||
std::string standardLibsVar = "CMAKE_";
|
std::string standardLibsVar = "CMAKE_";
|
||||||
|
@ -1220,15 +1225,24 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
||||||
{
|
{
|
||||||
fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n";
|
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=\""
|
fout << "\t\t\t\tSubSystem=\""
|
||||||
<< (this->FortranProject? "subSystemWindows" : "2") << "\"\n";
|
<< (isWin32Executable ? "subSystemWindows" : "subSystemConsole")
|
||||||
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fout << "\t\t\t\tSubSystem=\""
|
fout << "\t\t\t\tSubSystem=\""
|
||||||
<< (this->FortranProject? "subSystemConsole" : "1") << "\"\n";
|
<< (isWin32Executable ? "2" : "1")
|
||||||
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
std::string stackVar = "CMAKE_";
|
std::string stackVar = "CMAKE_";
|
||||||
stackVar += linkLanguage;
|
stackVar += linkLanguage;
|
||||||
|
|
|
@ -122,6 +122,7 @@ private:
|
||||||
cmVS7FlagTable const* ExtraFlagTable;
|
cmVS7FlagTable const* ExtraFlagTable;
|
||||||
std::string ModuleDefinitionFile;
|
std::string ModuleDefinitionFile;
|
||||||
bool FortranProject;
|
bool FortranProject;
|
||||||
|
bool WindowsCEProject;
|
||||||
std::string PlatformName; // Win32 or x64
|
std::string PlatformName; // Win32 or x64
|
||||||
cmLocalVisualStudio7GeneratorInternals* Internal;
|
cmLocalVisualStudio7GeneratorInternals* Internal;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue