ENH: remove ifdef code and use makefile definitions

This commit is contained in:
Bill Hoffman 2003-08-22 11:56:44 -04:00
parent 9cc69e8292
commit 26c08ee33b
1 changed files with 28 additions and 26 deletions

View File

@ -296,9 +296,10 @@ void cmLocalUnixMakefileGenerator::OutputMakefile(const char* file,
#if defined(_WIN32) && ! defined(__CYGWIN__)
std::string cmLocalUnixMakefileGenerator::GetOutputExtension(const char* s) std::string cmLocalUnixMakefileGenerator::GetOutputExtension(const char* s)
{ {
if(m_Makefile->IsOn("WIN32") && !(m_Makefile->IsOn("CYGWIN") || m_Makefile->IsOn("MINGW")))
{
std::string sourceExtension = s; std::string sourceExtension = s;
if(sourceExtension == "def") if(sourceExtension == "def")
{ {
@ -313,13 +314,12 @@ std::string cmLocalUnixMakefileGenerator::GetOutputExtension(const char* s)
return ".res"; return ".res";
} }
return ".obj"; return ".obj";
} }
#else else
std::string cmLocalUnixMakefileGenerator::GetOutputExtension(const char*) {
{
return ".o"; return ".o";
}
} }
#endif
std::string cmLocalUnixMakefileGenerator::GetFullTargetName(const char* n, std::string cmLocalUnixMakefileGenerator::GetFullTargetName(const char* n,
const cmTarget& t) const cmTarget& t)
@ -1051,7 +1051,8 @@ void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout,
linkFlags += this->GetSafeDefinition(build.c_str()); linkFlags += this->GetSafeDefinition(build.c_str());
linkFlags += " "; linkFlags += " ";
} }
#ifdef _WIN32 if(m_Makefile->IsOn("WIN32") && !(m_Makefile->IsOn("CYGWIN") || m_Makefile->IsOn("MINGW")))
{
const std::vector<cmSourceFile*>& sources = t.GetSourceFiles(); const std::vector<cmSourceFile*>& sources = t.GetSourceFiles();
for(std::vector<cmSourceFile*>::const_iterator i = sources.begin(); for(std::vector<cmSourceFile*>::const_iterator i = sources.begin();
i != sources.end(); ++i) i != sources.end(); ++i)
@ -1063,7 +1064,8 @@ void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout,
linkFlags += " "; linkFlags += " ";
} }
} }
#endif }
const char* targetPrefix = t.GetProperty("PREFIX"); const char* targetPrefix = t.GetProperty("PREFIX");
if(!targetPrefix) if(!targetPrefix)
{ {