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

Method WriteObjectsVariable

Source/cmMakefileTargetGenerator.cxx:1832–1877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1830}
1831
1832void cmMakefileTargetGenerator::WriteObjectsVariable(
1833 std::string& variableName, std::string& variableNameExternal,
1834 bool useWatcomQuote)
1835{
1836 // Write a make variable assignment that lists all objects for the
1837 // target.
1838 variableName = this->LocalGenerator->CreateMakeVariable(
1839 this->GeneratorTarget->GetName(), "_OBJECTS");
1840 *this->BuildFileStream << "# Object files for target "
1841 << this->GeneratorTarget->GetName() << "\n"
1842 << variableName << " =";
1843 auto const& lineContinue = this->GlobalGenerator->LineContinueDirective;
1844
1845 cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION");
1846
1847 for (std::string const& obj : this->Objects) {
1848 if (cmHasSuffix(obj, pchExtension)) {
1849 continue;
1850 }
1851 *this->BuildFileStream << " " << lineContinue;
1852 *this->BuildFileStream
1853 << cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
1854 obj, useWatcomQuote);
1855 }
1856 *this->BuildFileStream << "\n";
1857
1858 // Write a make variable assignment that lists all external objects
1859 // for the target.
1860 variableNameExternal = this->LocalGenerator->CreateMakeVariable(
1861 this->GeneratorTarget->GetName(), "_EXTERNAL_OBJECTS");
1862 /* clang-format off */
1863 *this->BuildFileStream
1864 << "\n"
1865 << "# External object files for target "
1866 << this->GeneratorTarget->GetName() << "\n"
1867 << variableNameExternal << " =";
1868 /* clang-format on */
1869 for (std::string const& obj : this->ExternalObjects) {
1870 *this->BuildFileStream << " " << lineContinue;
1871 *this->BuildFileStream
1872 << cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
1873 obj, useWatcomQuote);
1874 }
1875 *this->BuildFileStream << "\n"
1876 << "\n";
1877}
1878
1879class cmMakefileTargetGeneratorObjectStrings
1880{

Callers 1

CreateObjectListsMethod · 0.95

Calls 4

cmHasSuffixFunction · 0.85
CreateMakeVariableMethod · 0.80
GetNameMethod · 0.45
GetDefinitionMethod · 0.45

Tested by

no test coverage detected