[cmake-commits] king committed cmAddCustomCommandCommand.h 1.24 1.25 cmGlobalGenerator.cxx 1.153 1.154 cmGlobalGenerator.h 1.66 1.67 cmGlobalWatcomWMakeGenerator.cxx 1.7 1.8 cmMakefile.cxx 1.355 1.356 cmMakefileTargetGenerator.cxx 1.45 1.46 cmSetSourceFilesPropertiesCommand.h 1.10 1.11

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Oct 2 10:20:55 EDT 2006


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv2476

Modified Files:
	cmAddCustomCommandCommand.h cmGlobalGenerator.cxx 
	cmGlobalGenerator.h cmGlobalWatcomWMakeGenerator.cxx 
	cmMakefile.cxx cmMakefileTargetGenerator.cxx 
	cmSetSourceFilesPropertiesCommand.h 
Log Message:
ENH: Added SYMBOLIC source file property to mark custom command outputs that are never actually created on disk.  This is used by the Watcom WMake generator to generate the .SYMBOLIC mark on the files in the make system.


Index: cmAddCustomCommandCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomCommandCommand.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmAddCustomCommandCommand.h	28 Sep 2006 15:30:46 -0000	1.24
+++ cmAddCustomCommandCommand.h	2 Oct 2006 14:20:52 -0000	1.25
@@ -112,7 +112,10 @@
       "Use of VERBATIM is recommended as it enables correct behavior. "
       "When VERBATIM is not given the behavior is platform specific. "
       "In the future VERBATIM may be enabled by default. The only reason "
-      "it is an option is to preserve compatibility with older CMake code.";
+      "it is an option is to preserve compatibility with older CMake code.\n"
+      "If the output of the custom command is not actually "
+      "created as a file on disk it should be marked as SYMBOLIC with "
+      "SET_SOURCE_FILES_PROPERTIES.";
     }
   
   cmTypeMacro(cmAddCustomCommandCommand, cmCommand);

Index: cmGlobalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- cmGlobalGenerator.h	31 Aug 2006 14:47:00 -0000	1.66
+++ cmGlobalGenerator.h	2 Oct 2006 14:20:52 -0000	1.67
@@ -156,6 +156,10 @@
   /** Get whether the generator should use a script for link commands.  */
   bool GetUseLinkScript() { return this->UseLinkScript; }
 
+  /** Get whether the generator should produce special marks on rules
+      producing symbolic (non-file) outputs.  */
+  bool GetNeedSymbolicMark() { return this->NeedSymbolicMark; }
+
   /*
    * Determine what program to use for building the project.
    */
@@ -210,6 +214,7 @@
     const cmCustomCommandLines* commandLines,
     std::vector<std::string> depends, bool depends_on_all = false);
 
+  bool NeedSymbolicMark;
   bool UseLinkScript;
   bool ForceUnixPaths;
   bool ToolSupportsColor;

Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- cmGlobalGenerator.cxx	28 Sep 2006 17:55:25 -0000	1.153
+++ cmGlobalGenerator.cxx	2 Oct 2006 14:20:52 -0000	1.154
@@ -31,6 +31,9 @@
 
 cmGlobalGenerator::cmGlobalGenerator()
 {
+  // By default the .SYMBOLIC dependency is not needed on symbolic rules.
+  this->NeedSymbolicMark = false;
+
   // by default use the native paths
   this->ForceUnixPaths = false;
 

Index: cmGlobalWatcomWMakeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalWatcomWMakeGenerator.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cmGlobalWatcomWMakeGenerator.cxx	11 May 2006 15:47:03 -0000	1.7
+++ cmGlobalWatcomWMakeGenerator.cxx	2 Oct 2006 14:20:52 -0000	1.8
@@ -23,6 +23,7 @@
   this->FindMakeProgramFile = "CMakeFindWMake.cmake";
   this->ForceUnixPaths = false;
   this->ToolSupportsColor = true;
+  this->NeedSymbolicMark = true;
   this->EmptyCommandsHack = "@cd .";
 }
 

Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- cmMakefileTargetGenerator.cxx	28 Sep 2006 20:40:35 -0000	1.45
+++ cmMakefileTargetGenerator.cxx	2 Oct 2006 14:20:53 -0000	1.46
@@ -862,12 +862,25 @@
   std::vector<std::string> depends;
   this->LocalGenerator->AppendCustomDepend(depends, cc);
 
+  // Check whether we need to bother checking for a symbolic output.
+  bool need_symbolic = this->GlobalGenerator->GetNeedSymbolicMark();
+
   // Write the rule.
   const std::vector<std::string>& outputs = cc.GetOutputs();
   std::vector<std::string>::const_iterator o = outputs.begin();
+  {
+  bool symbolic = false;
+  if(need_symbolic)
+    {
+    if(cmSourceFile* sf = this->Makefile->GetSource(o->c_str()))
+      {
+      symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+      }
+    }
   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
                                       o->c_str(), depends, commands,
-                                      false);
+                                      symbolic);
+  }
 
   // If the rule has multiple outputs, add a rule for the extra
   // outputs to just depend on the first output with no command.  Also
@@ -887,9 +900,17 @@
     }
   for(++o; o != outputs.end(); ++o)
     {
+    bool symbolic = false;
+    if(need_symbolic)
+      {
+      if(cmSourceFile* sf = this->Makefile->GetSource(o->c_str()))
+        {
+        symbolic = sf->GetPropertyAsBool("SYMBOLIC");
+        }
+      }
     this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
                                         o->c_str(), depends, commands,
-                                        false);
+                                        symbolic);
     gg->AddMultipleOutputPair(o->c_str(), depends[0].c_str());
     }
 }

Index: cmSetSourceFilesPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetSourceFilesPropertiesCommand.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cmSetSourceFilesPropertiesCommand.h	12 May 2006 17:53:21 -0000	1.10
+++ cmSetSourceFilesPropertiesCommand.h	2 Oct 2006 14:20:53 -0000	1.11
@@ -74,7 +74,10 @@
         "only used by Makefiles).  "
         "OBJECT_DEPENDS (string) adds dependencies to the object file.  "
         "COMPILE_FLAGS (string) is passed to the compiler as additional "
-        "command line arguments when the source file is compiled.  ";
+        "command line arguments when the source file is compiled.  "
+        "If SYMBOLIC (boolean) is set to true the build system will be "
+        "informed that the source file is not actually created on disk but "
+        "instead used as a symbolic name for a build rule.";
       
     }
   

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.355
retrieving revision 1.356
diff -u -d -r1.355 -r1.356
--- cmMakefile.cxx	28 Sep 2006 20:40:35 -0000	1.355
+++ cmMakefile.cxx	2 Oct 2006 14:20:52 -0000	1.356
@@ -846,6 +846,17 @@
                                  escapeOldStyle);
   target.GetSourceLists().push_back(force);
 
+  // The output is not actually created so mark it symbolic.
+  if(cmSourceFile* sf = this->GetSource(force.c_str()))
+    {
+    sf->SetProperty("SYMBOLIC", "1");
+    }
+  else
+    {
+    cmSystemTools::Error("Could not get source file entry for ",
+                         force.c_str());
+    }
+
   // Add the target to the set of targets.
   cmTargets::iterator it = 
     this->Targets.insert(cmTargets::value_type(utilityName,target)).first;



More information about the Cmake-commits mailing list