| 49 | auto const DL_END = "</DEVICE_LINK>"_s; |
| 50 | |
| 51 | void processOptions(cmGeneratorTarget const* tgt, |
| 52 | EvaluatedTargetPropertyEntries const& entries, |
| 53 | std::vector<BT<std::string>>& options, |
| 54 | std::unordered_set<std::string>& uniqueOptions, |
| 55 | bool debugOptions, char const* logName, OptionsParse parse, |
| 56 | bool processDeviceOptions = false) |
| 57 | { |
| 58 | bool splitOption = !processDeviceOptions; |
| 59 | for (EvaluatedTargetPropertyEntry const& entry : entries.Entries) { |
| 60 | std::string usedOptions; |
| 61 | for (std::string const& opt : entry.Values) { |
| 62 | if (processDeviceOptions && (opt == DL_BEGIN || opt == DL_END)) { |
| 63 | options.emplace_back(opt, entry.Backtrace); |
| 64 | splitOption = opt == DL_BEGIN; |
| 65 | continue; |
| 66 | } |
| 67 | |
| 68 | if (uniqueOptions.insert(opt).second) { |
| 69 | if (parse == OptionsParse::Shell && |
| 70 | cmHasLiteralPrefix(opt, "SHELL:")) { |
| 71 | if (splitOption) { |
| 72 | std::vector<std::string> tmp; |
| 73 | cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, tmp); |
| 74 | for (std::string& o : tmp) { |
| 75 | options.emplace_back(std::move(o), entry.Backtrace); |
| 76 | } |
| 77 | } else { |
| 78 | options.emplace_back(std::string(opt.c_str() + 6), |
| 79 | entry.Backtrace); |
| 80 | } |
| 81 | } else { |
| 82 | options.emplace_back(opt, entry.Backtrace); |
| 83 | } |
| 84 | if (debugOptions) { |
| 85 | usedOptions += cmStrCat(" * ", opt, '\n'); |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | if (!usedOptions.empty()) { |
| 90 | tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage( |
| 91 | MessageType::LOG, |
| 92 | cmStrCat("Used ", logName, " for target ", tgt->GetName(), ":\n", |
| 93 | usedOptions), |
| 94 | entry.Backtrace); |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | enum class NestedLinkerFlags |
| 100 | { |
no test coverage detected
searching dependent graphs…