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

Method CreateObjectLists

Source/cmMakefileTargetGenerator.cxx:2252–2302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2250}
2251
2252void cmMakefileTargetGenerator::CreateObjectLists(
2253 bool useLinkScript, bool useArchiveRules, bool useResponseFile,
2254 std::string& buildObjs, std::vector<std::string>& makefile_depends,
2255 bool useWatcomQuote, std::string const& linkLanguage,
2256 ResponseFlagFor responseMode)
2257{
2258 std::string variableName;
2259 std::string variableNameExternal;
2260 this->WriteObjectsVariable(variableName, variableNameExternal,
2261 useWatcomQuote);
2262 if (useResponseFile) {
2263 // MSVC response files cannot exceed 128K.
2264 std::string::size_type constexpr responseFileLimit = 131000;
2265
2266 // Construct the individual object list strings.
2267 std::vector<std::string> object_strings;
2268 this->WriteObjectsStrings(object_strings, useWatcomQuote,
2269 responseFileLimit);
2270
2271 // Lookup the response file reference flag.
2272 std::string const responseFlag = this->GetResponseFlag(responseMode);
2273
2274 // Write a response file for each string.
2275 char const* sep = "";
2276 for (unsigned int i = 0; i < object_strings.size(); ++i) {
2277 // Number the response files.
2278 std::string responseFileName = cmStrCat(
2279 (responseMode == Link) ? "objects" : "deviceObjects", i + 1, ".rsp");
2280
2281 // Create this response file.
2282 std::string objects_rsp = this->CreateResponseFile(
2283 responseFileName, object_strings[i], makefile_depends, linkLanguage);
2284
2285 buildObjs +=
2286 cmStrCat(sep, // Separate from previous response file references.
2287 responseFlag, // Reference the response file.
2288 this->LocalGenerator->ConvertToOutputFormat(
2289 objects_rsp, cmOutputConverter::SHELL));
2290 sep = " ";
2291 }
2292 } else if (useLinkScript) {
2293 if (!useArchiveRules) {
2294 std::vector<std::string> objStrings;
2295 this->WriteObjectsStrings(objStrings, useWatcomQuote);
2296 buildObjs = objStrings[0];
2297 }
2298 } else {
2299 buildObjs =
2300 cmStrCat("$(", variableName, ") $(", variableNameExternal, ')');
2301 }
2302}
2303
2304void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
2305 std::string const& lang,

Callers 4

WriteExecutableRuleMethod · 0.80
WriteLibraryRulesMethod · 0.80

Calls 7

WriteObjectsVariableMethod · 0.95
WriteObjectsStringsMethod · 0.95
GetResponseFlagMethod · 0.95
CreateResponseFileMethod · 0.95
cmStrCatFunction · 0.70
sizeMethod · 0.45
ConvertToOutputFormatMethod · 0.45

Tested by

no test coverage detected