Jelajahi Sumber

CodeLite generator: simplify code a bit

Rolf Eike Beer 11 tahun lalu
induk
melakukan
c8e565a06e
1 mengubah file dengan 4 tambahan dan 8 penghapusan
  1. 4 8
      Source/cmExtraCodeLiteGenerator.cxx

+ 4 - 8
Source/cmExtraCodeLiteGenerator.cxx

@@ -443,26 +443,22 @@ cmExtraCodeLiteGenerator::GetConfigurationName(const cmMakefile* mf) const
 std::string
 std::string
 cmExtraCodeLiteGenerator::GetBuildCommand(const cmMakefile* mf) const
 cmExtraCodeLiteGenerator::GetBuildCommand(const cmMakefile* mf) const
 {
 {
-  std::stringstream ss;
   std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
   std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
   std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
   std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
   std::string buildCommand = make; // Default
   std::string buildCommand = make; // Default
-  if ( generator == "NMake Makefiles" )
+  if ( generator == "NMake Makefiles" ||
+       generator == "Ninja" )
     {
     {
     buildCommand = make;
     buildCommand = make;
     }
     }
   else if ( generator == "MinGW Makefiles" ||
   else if ( generator == "MinGW Makefiles" ||
             generator == "Unix Makefiles" )
             generator == "Unix Makefiles" )
     {
     {
+    std::stringstream ss;
     ss << make << " -j " << this->CpuCount;
     ss << make << " -j " << this->CpuCount;
     buildCommand = ss.str();
     buildCommand = ss.str();
     }
     }
-  else if ( generator == "Ninja" )
-    {
-    ss << make;
-    buildCommand = ss.str();
-    }
-    return buildCommand;
+  return buildCommand;
 }
 }
 
 
 std::string
 std::string