diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 19 | ||||
-rw-r--r-- | Source/cmSourceFile.cxx | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 2417b4a..b2b3fa1 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -517,6 +517,25 @@ cmMakefileTargetGenerator relativeObj.c_str(), depends, commands, false); + // Check for extra outputs created by the compilation. + if(const char* extra_outputs_str = + source.GetProperty("OBJECT_OUTPUTS")) + { + std::vector<std::string> extra_outputs; + cmSystemTools::ExpandListArgument(extra_outputs_str, extra_outputs); + for(std::vector<std::string>::const_iterator eoi = extra_outputs.begin(); + eoi != extra_outputs.end(); ++eoi) + { + // Register this as an extra output for the object file rule. + // This will cause the object file to be rebuilt if the extra + // output is missing. + this->GenerateExtraOutput(eoi->c_str(), relativeObj.c_str(), false); + + // Register this as an extra file to clean. + this->CleanFiles.push_back(eoi->c_str()); + } + } + bool lang_is_c_or_cxx = ((strcmp(lang, "C") == 0) || (strcmp(lang, "CXX") == 0)); bool do_preprocess_rules = lang_is_c_or_cxx && diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index c9d0c48..1468869 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -402,6 +402,14 @@ void cmSourceFile::DefineProperties(cmake *cm) "building this source file."); cm->DefineProperty + ("OBJECT_OUTPUTS", cmProperty::SOURCE_FILE, + "Additional outputs for a Makefile rule.", + "Additional outputs created by compilation of this source file. " + "If any of these outputs is missing the object will be recompiled. " + "This is supported only on Makefile generators and will be ignored " + "on other generators."); + + cm->DefineProperty ("SYMBOLIC", cmProperty::SOURCE_FILE, "Is this just a name for a rule.", "If SYMBOLIC (boolean) is set to true the build system will be " |