Selaa lähdekoodia

BUG: cmGlobalGenerator::Build should not always use the /fast target name because dependency checking is often required. It now takes an argument specifying whether to use the /fast target name, and the argument is currently only true for try-compiles.

Brad King 19 vuotta sitten
vanhempi
sitoutus
87d4d0e039

+ 1 - 1
Source/CPack/cmCPackGenericGenerator.cxx

@@ -346,7 +346,7 @@ int cmCPackGenericGenerator::InstallProject()
           = globalGenerator->GenerateBuildCommand(cmakeMakeProgram,
             installProjectName.c_str(), 0, 
             globalGenerator->GetPreinstallTargetName(),
-            buildConfig, false);
+            buildConfig, false, false);
         cmCPackLogger(cmCPackLog::LOG_DEBUG,
           "- Install command: " << buildCommand << std::endl);
         cmCPackLogger(cmCPackLog::LOG_OUTPUT,

+ 1 - 1
Source/CTest/cmCTestBuildAndTestHandler.cxx

@@ -196,7 +196,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
       this->SourceDir.c_str(), this->BinaryDir.c_str(),
       this->BuildProject.c_str(), tarIt->c_str(),
       &output, this->BuildMakeProgram.c_str(),
-      this->CTest->GetConfigType().c_str(),!this->BuildNoClean);
+      this->CTest->GetConfigType().c_str(),!this->BuildNoClean, false);
 
     out << output;
     // if the build failed then return

+ 1 - 1
Source/CTest/cmCTestBuildCommand.cxx

@@ -93,7 +93,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
       std::string buildCommand
         = this->GlobalGenerator->GenerateBuildCommand(cmakeMakeProgram,
           cmakeProjectName,
-          cmakeBuildAdditionalFlags, 0, cmakeBuildConfiguration, true);
+          cmakeBuildAdditionalFlags, 0, cmakeBuildConfiguration, true, false);
       this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str());
       }
     else

+ 1 - 1
Source/cmBuildCommand.cxx

@@ -34,7 +34,7 @@ bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
   std::string makecommand = this->Makefile->GetLocalGenerator()
     ->GetGlobalGenerator()->GenerateBuildCommand
     (makeprogram.c_str(), this->Makefile->GetProjectName(), 0,
-     0, "Release", true);
+     0, "Release", true, false);
 
   if(cacheValue)
     {

+ 5 - 5
Source/cmGlobalGenerator.cxx

@@ -770,13 +770,13 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
   const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
   return this->Build(srcdir,bindir,projectName,
                      newTarget.c_str(),
-                     output,makeCommand.c_str(),config,false);
+                     output,makeCommand.c_str(),config,false,true);
 }
 
 std::string cmGlobalGenerator
 ::GenerateBuildCommand(const char* makeProgram, const char *projectName, 
                        const char* additionalOptions, const char *targetName,
-                       const char* config, bool ignoreErrors)
+                       const char* config, bool ignoreErrors, bool)
 {
   // Project name and config are not used yet.
   (void)projectName;
@@ -814,7 +814,7 @@ int cmGlobalGenerator::Build(
   std::string *output, 
   const char *makeCommandCSTR,
   const char *config,
-  bool clean)
+  bool clean, bool fast)
 {
   *output += "\nTesting TryCompileWithoutMakefile\n";
   
@@ -834,7 +834,7 @@ int cmGlobalGenerator::Build(
     {
     std::string cleanCommand = 
       this->GenerateBuildCommand(makeCommandCSTR, projectName,
-      0, "clean", config, false);
+      0, "clean", config, false, fast);
     if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output, 
                                          &retVal, 0, false, timeout))
       {
@@ -854,7 +854,7 @@ int cmGlobalGenerator::Build(
   // now build
   std::string makeCommand = 
     this->GenerateBuildCommand(makeCommandCSTR, projectName,
-                               0, target, config, false);
+                               0, target, config, false, fast);
   
   if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, 
                                        &retVal, 0, false, timeout))

+ 2 - 2
Source/cmGlobalGenerator.h

@@ -100,12 +100,12 @@ public:
                     const char *projectName, const char *targetName,
                     std::string *output, 
                     const char *makeProgram, const char *config,
-                    bool clean);
+                    bool clean, bool fast);
   virtual std::string GenerateBuildCommand
   (const char* makeProgram,
    const char *projectName, const char* additionalOptions, 
    const char *targetName,
-   const char* config, bool ignoreErrors);
+   const char* config, bool ignoreErrors, bool fast);
 
 
   ///! Set the CMake instance

+ 5 - 2
Source/cmGlobalUnixMakefileGenerator3.cxx

@@ -597,7 +597,7 @@ cmGlobalUnixMakefileGenerator3
 std::string cmGlobalUnixMakefileGenerator3
 ::GenerateBuildCommand(const char* makeProgram, const char *projectName, 
                        const char* additionalOptions, const char *targetName,
-                       const char* config, bool ignoreErrors)
+                       const char* config, bool ignoreErrors, bool fast)
 {
   // Project name and config are not used yet.
   (void)projectName;
@@ -644,7 +644,10 @@ std::string cmGlobalUnixMakefileGenerator3
     lg->SetupPathConversions();
     makeCommand += " \"";
     std::string tname = targetName;
-    tname += "/fast";
+    if(fast)
+      {
+      tname += "/fast";
+      }
     tname = lg->Convert(tname.c_str(),cmLocalGenerator::HOME_OUTPUT,
                         cmLocalGenerator::MAKEFILE);
     tname = lg->ConvertToMakeTarget(tname.c_str());

+ 1 - 1
Source/cmGlobalUnixMakefileGenerator3.h

@@ -121,7 +121,7 @@ public:
   (const char* makeProgram,
    const char *projectName, const char* additionalOptions, 
    const char *targetName,
-   const char* config, bool ignoreErrors);
+   const char* config, bool ignoreErrors, bool fast);
 
   // returns true if a progress rule should be added
   int ShouldAddProgressRule();

+ 2 - 1
Source/cmGlobalVisualStudio6Generator.cxx

@@ -73,7 +73,8 @@ std::string cmGlobalVisualStudio6Generator
                        const char* additionalOptions, 
                        const char *targetName,
                        const char* config, 
-                       bool ignoreErrors)
+                       bool ignoreErrors,
+                       bool)
 {
   // Ingoring errors is not implemented in visual studio 6
   (void) ignoreErrors;

+ 2 - 1
Source/cmGlobalVisualStudio6Generator.h

@@ -60,7 +60,8 @@ public:
                                            const char* additionalOptions, 
                                            const char *targetName, 
                                            const char* config,
-                                           bool ignoreErrors);
+                                           bool ignoreErrors,
+                                           bool fast);
 
   /**
    * Generate the all required files for building this project/tree. This

+ 1 - 1
Source/cmGlobalVisualStudio7Generator.cxx

@@ -71,7 +71,7 @@ std::string cmGlobalVisualStudio7Generator
 ::GenerateBuildCommand(const char* makeProgram,
                        const char *projectName, 
                        const char* additionalOptions, const char *targetName,
-                       const char* config, bool ignoreErrors)
+                       const char* config, bool ignoreErrors, bool)
 {
   // Ingoring errors is not implemented in visual studio 6
   (void) ignoreErrors;

+ 2 - 1
Source/cmGlobalVisualStudio7Generator.h

@@ -60,7 +60,8 @@ public:
                                            const char* additionalOptions, 
                                            const char *targetName,
                                            const char* config,
-                                           bool ignoreErrors);
+                                           bool ignoreErrors,
+                                           bool fast);
 
   /**
    * Generate the all required files for building this project/tree. This

+ 2 - 1
Source/cmGlobalXCodeGenerator.cxx

@@ -133,7 +133,8 @@ std::string cmGlobalXCodeGenerator
                        const char* additionalOptions, 
                        const char *targetName,
                        const char* config, 
-                       bool ignoreErrors)
+                       bool ignoreErrors,
+                       bool)
 {
   // Config is not used yet
   (void) ignoreErrors;

+ 2 - 1
Source/cmGlobalXCodeGenerator.h

@@ -63,7 +63,8 @@ public:
                                            const char* additionalOptions, 
                                            const char *targetName,
                                            const char* config, 
-                                           bool ignoreErrors);
+                                           bool ignoreErrors,
+                                           bool fast);
 
   /**
    * Generate the all required files for building this project/tree. This