summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2020-11-09 00:06:51 (GMT)
committerDeniz Bahadir <dbahadir@benocs.com>2020-11-24 17:16:51 (GMT)
commit6624b65b3f478574512a23a7220abff4ed590011 (patch)
tree41a239c43b3a223ea8f27beac5b12d299d39c62c /Source/cmMakefile.cxx
parentb14fe704f8fad5785f10f0d56c5b49a8e0e0e94c (diff)
downloadCMake-6624b65b3f478574512a23a7220abff4ed590011.zip
CMake-6624b65b3f478574512a23a7220abff4ed590011.tar.gz
CMake-6624b65b3f478574512a23a7220abff4ed590011.tar.bz2
GENERATED prop: Add implementation for policy CMP0118 being set to NEW
* Adding implementation for policy CMP0118 being set to `NEW`. * Adding new tests for policy CMP0118 being set to `NEW`. * Checking the `GENERATED` property with `get_source_file_property` or `get_property` now always returns exactly `1` or `0`. No other values will be returned. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * Additionally, as `get_source_file_property` and `get_property` now always check if a source-file was marked globally visible, even when CMP0118 is unset or set to `OLD`, they possibly return `1` where they might have returned `0` before the changes introduced by this commit. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * As a consequence, the tests for policy CMP0118 being unset or set to `OLD` got slightly adjusted, too, to reflect these changes in behavior.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 50a7d27..4e93785 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3406,11 +3406,7 @@ cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName,
bool generated,
cmSourceFileLocationKind kind)
{
- auto sf = cm::make_unique<cmSourceFile>(this, sourceName, kind);
- if (generated) {
- sf->SetProperty("GENERATED", "1");
- }
-
+ auto sf = cm::make_unique<cmSourceFile>(this, sourceName, generated, kind);
auto name =
this->GetCMakeInstance()->StripExtension(sf->GetLocation().GetName());
#if defined(_WIN32) || defined(__APPLE__)
@@ -3442,7 +3438,7 @@ cmSourceFile* cmMakefile::GetOrCreateGeneratedSource(
{
cmSourceFile* sf =
this->GetOrCreateSource(sourceName, true, cmSourceFileLocationKind::Known);
- sf->SetProperty("GENERATED", "1");
+ sf->MarkAsGenerated(); // In case we did not create the source file.
return sf;
}