Merge topic 'wince-entrypoint'

34969cf Fix setting of the entry point symbol for Windows CE (#14088)
5e0252c Improve const-correctness in cmVisualStudioGeneratorOptions
This commit is contained in:
Brad King 2013-08-06 16:55:22 -04:00 committed by CMake Topic Stage
commit a3b86cf711
4 changed files with 19 additions and 16 deletions

View File

@ -920,7 +920,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
} }
this->OutputTargetRules(fout, configName, target, libName); this->OutputTargetRules(fout, configName, target, libName);
this->OutputBuildTool(fout, configName, target, targetOptions.IsDebug()); this->OutputBuildTool(fout, configName, target, targetOptions);
fout << "\t\t</Configuration>\n"; fout << "\t\t</Configuration>\n";
} }
@ -941,9 +941,7 @@ cmLocalVisualStudio7Generator
} }
void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
const char* configName, const char* configName, cmTarget &target, const Options& targetOptions)
cmTarget &target,
bool isDebug)
{ {
cmGlobalVisualStudio7Generator* gg = cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
@ -1111,7 +1109,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
temp += targetNamePDB; temp += targetNamePDB;
fout << "\t\t\t\tProgramDatabaseFile=\"" << fout << "\t\t\t\tProgramDatabaseFile=\"" <<
this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
if(isDebug) if(targetOptions.IsDebug())
{ {
fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n";
} }
@ -1209,7 +1207,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "\t\t\t\tProgramDatabaseFile=\"" fout << "\t\t\t\tProgramDatabaseFile=\""
<< path << "/" << targetNamePDB << path << "/" << targetNamePDB
<< "\"\n"; << "\"\n";
if(isDebug) if(targetOptions.IsDebug())
{ {
fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n"; fout << "\t\t\t\tGenerateDebugInformation=\"TRUE\"\n";
} }
@ -1223,9 +1221,14 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
{ {
fout << "\t\t\t\tSubSystem=\"8\"\n"; fout << "\t\t\t\tSubSystem=\"8\"\n";
} }
fout << "\t\t\t\tEntryPointSymbol=\""
<< (isWin32Executable ? "WinMainCRTStartup" : "mainACRTStartup") if(!linkOptions.GetFlag("EntryPointSymbol"))
<< "\"\n"; {
const char* entryPointSymbol = targetOptions.UsingUnicode() ?
(isWin32Executable ? "wWinMainCRTStartup" : "mainWCRTStartup") :
(isWin32Executable ? "WinMainCRTStartup" : "mainACRTStartup");
fout << "\t\t\t\tEntryPointSymbol=\"" << entryPointSymbol << "\"\n";
}
} }
else if ( this->FortranProject ) else if ( this->FortranProject )
{ {

View File

@ -90,7 +90,7 @@ private:
void OutputTargetRules(std::ostream& fout, const char* configName, void OutputTargetRules(std::ostream& fout, const char* configName,
cmTarget &target, const char *libName); cmTarget &target, const char *libName);
void OutputBuildTool(std::ostream& fout, const char* configName, void OutputBuildTool(std::ostream& fout, const char* configName,
cmTarget& t, bool debug); cmTarget& t, const Options& targetOptions);
void OutputLibraryDirectories(std::ostream& fout, void OutputLibraryDirectories(std::ostream& fout,
std::vector<std::string> const& dirs); std::vector<std::string> const& dirs);
void WriteProjectSCC(std::ostream& fout, cmTarget& target); void WriteProjectSCC(std::ostream& fout, cmTarget& target);

View File

@ -100,13 +100,13 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
} }
} }
bool cmVisualStudioGeneratorOptions::IsDebug() bool cmVisualStudioGeneratorOptions::IsDebug() const
{ {
return this->FlagMap.find("DebugInformationFormat") != this->FlagMap.end(); return this->FlagMap.find("DebugInformationFormat") != this->FlagMap.end();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmVisualStudioGeneratorOptions::UsingUnicode() bool cmVisualStudioGeneratorOptions::UsingUnicode() const
{ {
// Look for the a _UNICODE definition. // Look for the a _UNICODE definition.
for(std::vector<std::string>::const_iterator di = this->Defines.begin(); for(std::vector<std::string>::const_iterator di = this->Defines.begin();
@ -120,7 +120,7 @@ bool cmVisualStudioGeneratorOptions::UsingUnicode()
return false; return false;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmVisualStudioGeneratorOptions::UsingSBCS() bool cmVisualStudioGeneratorOptions::UsingSBCS() const
{ {
// Look for the a _SBCS definition. // Look for the a _SBCS definition.
for(std::vector<std::string>::const_iterator di = this->Defines.begin(); for(std::vector<std::string>::const_iterator di = this->Defines.begin();

View File

@ -47,10 +47,10 @@ public:
void SetVerboseMakefile(bool verbose); void SetVerboseMakefile(bool verbose);
// Check for specific options. // Check for specific options.
bool UsingUnicode(); bool UsingUnicode() const;
bool UsingSBCS(); bool UsingSBCS() const;
bool IsDebug(); bool IsDebug() const;
// Write options to output. // Write options to output.
void OutputPreprocessorDefinitions(std::ostream& fout, void OutputPreprocessorDefinitions(std::ostream& fout,
const char* prefix, const char* prefix,