summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-06-12 08:12:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-07-12 14:57:36 (GMT)
commitd7dd01083a99055d689c80fe28bbc79a11bf3da1 (patch)
tree9da31f8cdfcd313524513b73e2e585684ff4eaa4 /Source/cmMakefile.cxx
parent184121538c2576b2113c0e256ecb0cd9ac354134 (diff)
downloadCMake-d7dd01083a99055d689c80fe28bbc79a11bf3da1.zip
CMake-d7dd01083a99055d689c80fe28bbc79a11bf3da1.tar.gz
CMake-d7dd01083a99055d689c80fe28bbc79a11bf3da1.tar.bz2
Add target property debugging for COMPILE_DEFINITIONS
Use constructs similar to those for COMPILE_OPTIONS. This is a little different because there is a command to remove_definitions(), so we can't populate the equivalent target property until generate-time in cmGlobalGenerator.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx41
1 files changed, 41 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f3a66ba..d94c93d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1505,6 +1505,12 @@ void cmMakefile::InitializeFromParent()
parentOptions.begin(),
parentOptions.end());
+ const std::vector<cmValueWithOrigin> parentDefines =
+ parent->GetCompileDefinitionsEntries();
+ this->CompileDefinitionsEntries.insert(this->CompileDefinitionsEntries.end(),
+ parentDefines.begin(),
+ parentDefines.end());
+
this->SystemIncludeDirectories = parent->SystemIncludeDirectories;
// define flags
@@ -3493,6 +3499,19 @@ void cmMakefile::SetProperty(const char* prop, const char* value)
this->CompileOptionsEntries.push_back(cmValueWithOrigin(value, lfbt));
return;
}
+ if (propname == "COMPILE_DEFINITIONS")
+ {
+ this->CompileDefinitionsEntries.clear();
+ if (!value)
+ {
+ return;
+ }
+ cmListFileBacktrace lfbt;
+ this->GetBacktrace(lfbt);
+ cmValueWithOrigin entry(value, lfbt);
+ this->CompileDefinitionsEntries.push_back(entry);
+ return;
+ }
if ( propname == "INCLUDE_REGULAR_EXPRESSION" )
{
@@ -3540,6 +3559,14 @@ void cmMakefile::AppendProperty(const char* prop, const char* value,
cmValueWithOrigin(value, lfbt));
return;
}
+ if (propname == "COMPILE_DEFINITIONS")
+ {
+ cmListFileBacktrace lfbt;
+ this->GetBacktrace(lfbt);
+ this->CompileDefinitionsEntries.push_back(
+ cmValueWithOrigin(value, lfbt));
+ return;
+ }
if ( propname == "LINK_DIRECTORIES" )
{
std::vector<std::string> varArgsExpanded;
@@ -3679,6 +3706,20 @@ const char *cmMakefile::GetProperty(const char* prop,
}
return output.c_str();
}
+ else if (!strcmp("COMPILE_DEFINITIONS",prop))
+ {
+ std::string sep;
+ for (std::vector<cmValueWithOrigin>::const_iterator
+ it = this->CompileDefinitionsEntries.begin(),
+ end = this->CompileDefinitionsEntries.end();
+ it != end; ++it)
+ {
+ output += sep;
+ output += it->Value;
+ sep = ";";
+ }
+ return output.c_str();
+ }
bool chain = false;
const char *retVal =