MCPcopy Create free account
hub / github.com/Kitware/CMake / processOptions

Function processOptions

Source/cmGeneratorTarget_Options.cxx:51–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49auto const DL_END = "</DEVICE_LINK>"_s;
50
51void 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
99enum class NestedLinkerFlags
100{

Callers 7

GetCompileOptionsMethod · 0.85
GetCompileFeaturesMethod · 0.85
GetCompileDefinitionsMethod · 0.85
GetPrecompileHeadersMethod · 0.85
GetLinkOptionsMethod · 0.85
GetLinkDependsMethod · 0.85

Calls 11

cmHasLiteralPrefixFunction · 0.85
moveFunction · 0.85
emplace_backMethod · 0.80
c_strMethod · 0.80
cmStrCatFunction · 0.70
insertMethod · 0.45
emptyMethod · 0.45
IssueMessageMethod · 0.45
GetCMakeInstanceMethod · 0.45
GetLocalGeneratorMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…