mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 06:40:16 -05:00
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.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user