cmTarget: Only append non-empty values to buildsystem properties.

This is a change in behavior from CMake 3.3, but there is no semantic meaning
to empty entries in buildsystem properties.  This also restores behavior to
that of CMake 2.8.10.
This commit is contained in:
Stephen Kelly 2015-09-10 22:58:04 +02:00
parent 8e8824149f
commit 08ce3f486e
6 changed files with 10 additions and 10 deletions

View File

@ -1706,7 +1706,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "INCLUDE_DIRECTORIES")
{
if (value)
if (value && *value)
{
this->Internal->IncludeDirectoriesEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@ -1715,7 +1715,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "COMPILE_OPTIONS")
{
if (value)
if (value && *value)
{
this->Internal->CompileOptionsEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@ -1724,7 +1724,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "COMPILE_FEATURES")
{
if (value)
if (value && *value)
{
this->Internal->CompileFeaturesEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@ -1733,7 +1733,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "COMPILE_DEFINITIONS")
{
if (value)
if (value && *value)
{
this->Internal->CompileDefinitionsEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@ -1749,7 +1749,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if (prop == "LINK_LIBRARIES")
{
if (value)
if (value && *value)
{
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmValueWithOrigin entry(value, lfbt);

View File

@ -1 +1 @@
-- Target COMPILE_DEFINITIONS is 'a;;b;c;;d;;e'
-- Target COMPILE_DEFINITIONS is 'a;b;c;d;;e'

View File

@ -1 +1 @@
-- Target COMPILE_FEATURES is 'a;;b;c;;d;;e'
-- Target COMPILE_FEATURES is 'a;b;c;d;;e'

View File

@ -1 +1 @@
-- Target COMPILE_OPTIONS is 'a;;b;c;;d;;e'
-- Target COMPILE_OPTIONS is 'a;b;c;d;;e'

View File

@ -1 +1 @@
-- Target INCLUDE_DIRECTORIES is 'a;;b;c;;d;;e'
-- Target INCLUDE_DIRECTORIES is 'a;b;c;d;;e'

View File

@ -1 +1 @@
-- Target LINK_LIBRARIES is 'a;;b;c;;d;;e'
-- Target LINK_LIBRARIES is 'a;b;c;d;;e'