Explorar el Código

BUG: Need to honor HEADER_FILE_ONLY source file property and exclude the source from the build.

Brad King hace 18 años
padre
commit
b94530c7b4
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      Source/cmLocalVisualStudio6Generator.cxx

+ 9 - 1
Source/cmLocalVisualStudio6Generator.cxx

@@ -427,6 +427,9 @@ void cmLocalVisualStudio6Generator
         compileFlags += " /TC ";
         }
       }
+
+    bool excludedFromBuild =
+      (lang && (*sf)->GetPropertyAsBool("HEADER_FILE_ONLY"));
       
     // Check for extra object-file dependencies.
     const char* dependsValue = (*sf)->GetProperty("OBJECT_DEPENDS");
@@ -460,7 +463,8 @@ void cmLocalVisualStudio6Generator
         const char* flags = compileFlags.size() ? compileFlags.c_str(): 0;
         this->WriteCustomRule(fout, source.c_str(), *command, flags);
         }
-      else if(!compileFlags.empty() || !objectNameDir.empty())
+      else if(!compileFlags.empty() || !objectNameDir.empty() ||
+              excludedFromBuild)
         {
         for(std::vector<std::string>::iterator i
               = this->Configurations.begin(); 
@@ -474,6 +478,10 @@ void cmLocalVisualStudio6Generator
             {
             fout << "!ELSEIF  \"$(CFG)\" == " << i->c_str() << std::endl;
             }
+          if(excludedFromBuild)
+            {
+            fout << "# PROP Exclude_From_Build 1\n";
+            }
           if(!compileFlags.empty())
             {
             fout << "\n# ADD CPP " << compileFlags << "\n\n";