summaryrefslogtreecommitdiff
path: root/Source/cmSetSourceFilesPropertiesCommand.cxx
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2020-09-30 21:11:14 +0200
committerDeniz Bahadir <dbahadir@benocs.com>2020-11-24 17:54:54 +0100
commitca4ce458a3a14889b1018198b6580ddddfb039a5 (patch)
treeb9317dd5ea89209ffbc1f9b2dfa0313e09a8b691 /Source/cmSetSourceFilesPropertiesCommand.cxx
parent0eb30f175e61a013db301ab1be242dd497be4add (diff)
downloadcmake-ca4ce458a3a14889b1018198b6580ddddfb039a5.tar.gz
GENERATED prop: Check CMP0118 policy and warn in certain situations
* Adding tests for CMP0118 being unset (aka set to `WARN`). * Adjusting the (unrelated) RunCMake.CMP0026 test to set CMP0118 to `NEW`, * Adjusting the (unrelated) RunCMake.Ninja test to set CMP0118 to `OLD`. * Adjusting the (unrelated) RunCMake.FileAPI test to set CMP0118 to `OLD`. Note: Setting CMP0118 to `NEW` and modifying the `GENERATED` property with `set_property` or `set_source_files_properties` will currently NOT set that property because the implementation is still to come.
Diffstat (limited to 'Source/cmSetSourceFilesPropertiesCommand.cxx')
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx
index 8520d7cc9a..742aa96b6f 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.cxx
+++ b/Source/cmSetSourceFilesPropertiesCommand.cxx
@@ -7,6 +7,7 @@
#include <cm/string_view>
#include <cmext/algorithm>
+#include <cmext/string_view>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
@@ -167,7 +168,13 @@ static bool RunCommandForScope(
if (cmSourceFile* sf = mf->GetOrCreateSource(sfname)) {
// loop through the props and set them
for (auto k = propertyPairs.begin(); k != propertyPairs.end(); k += 2) {
- sf->SetProperty(*k, (k + 1)->c_str());
+ // Special handling for GENERATED property?
+ if (*k == "GENERATED"_s) {
+ SetPropertyCommand::HandleAndValidateSourceFilePropertyGENERATED(
+ sf, *(k + 1));
+ } else {
+ sf->SetProperty(*k, (k + 1)->c_str());
+ }
}
}
}