diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-08-22 15:56:44 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-08-22 15:56:44 (GMT) |
commit | 26c08ee33b29a9b9b0ac01d5cfd26ff18759c43c (patch) | |
tree | 425204d73db3142fd536ab94cd87e227908ad65a /Source/cmLocalUnixMakefileGenerator.cxx | |
parent | 9cc69e82928bdd3735e6aeb035c87d93cedf2735 (diff) | |
download | CMake-26c08ee33b29a9b9b0ac01d5cfd26ff18759c43c.zip CMake-26c08ee33b29a9b9b0ac01d5cfd26ff18759c43c.tar.gz CMake-26c08ee33b29a9b9b0ac01d5cfd26ff18759c43c.tar.bz2 |
ENH: remove ifdef code and use makefile definitions
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 01a535e..68e9834 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -296,30 +296,30 @@ void cmLocalUnixMakefileGenerator::OutputMakefile(const char* file, -#if defined(_WIN32) && ! defined(__CYGWIN__) std::string cmLocalUnixMakefileGenerator::GetOutputExtension(const char* s) { - std::string sourceExtension = s; - if(sourceExtension == "def") + if(m_Makefile->IsOn("WIN32") && !(m_Makefile->IsOn("CYGWIN") || m_Makefile->IsOn("MINGW"))) { - return ""; - } - if(sourceExtension == "ico" || sourceExtension == "rc2") - { - return ""; + std::string sourceExtension = s; + if(sourceExtension == "def") + { + return ""; + } + if(sourceExtension == "ico" || sourceExtension == "rc2") + { + return ""; + } + if(sourceExtension == "rc") + { + return ".res"; + } + return ".obj"; } - if(sourceExtension == "rc") + else { - return ".res"; + return ".o"; } - return ".obj"; } -#else -std::string cmLocalUnixMakefileGenerator::GetOutputExtension(const char*) -{ - return ".o"; -} -#endif std::string cmLocalUnixMakefileGenerator::GetFullTargetName(const char* n, const cmTarget& t) @@ -1051,19 +1051,21 @@ void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout, linkFlags += this->GetSafeDefinition(build.c_str()); linkFlags += " "; } -#ifdef _WIN32 - const std::vector<cmSourceFile*>& sources = t.GetSourceFiles(); - for(std::vector<cmSourceFile*>::const_iterator i = sources.begin(); - i != sources.end(); ++i) + if(m_Makefile->IsOn("WIN32") && !(m_Makefile->IsOn("CYGWIN") || m_Makefile->IsOn("MINGW"))) { - if((*i)->GetSourceExtension() == "def") + const std::vector<cmSourceFile*>& sources = t.GetSourceFiles(); + for(std::vector<cmSourceFile*>::const_iterator i = sources.begin(); + i != sources.end(); ++i) { - linkFlags += this->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); - linkFlags += cmSystemTools::ConvertToOutputPath((*i)->GetFullPath().c_str()); - linkFlags += " "; + if((*i)->GetSourceExtension() == "def") + { + linkFlags += this->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); + linkFlags += cmSystemTools::ConvertToOutputPath((*i)->GetFullPath().c_str()); + linkFlags += " "; + } } } -#endif + const char* targetPrefix = t.GetProperty("PREFIX"); if(!targetPrefix) { |