summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-10 18:48:57 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-11 14:09:57 (GMT)
commit22829a130482511f8310caf74e190baee7ec763b (patch)
treefe2846f08b0578fccb7f6cde3421c06f6be8efd3 /Source/cmMakefile.cxx
parent0419ecbcad7719614349a07189b45e341a8f2c69 (diff)
downloadCMake-22829a130482511f8310caf74e190baee7ec763b.zip
CMake-22829a130482511f8310caf74e190baee7ec763b.tar.gz
CMake-22829a130482511f8310caf74e190baee7ec763b.tar.bz2
cmMakefile: Create an explicit "Object Libraries" source group
The generators should not need special logic to place object library object files in this group.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f7d822a..9c68ccf 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -94,6 +94,10 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->AddSourceGroup("CMake Rules", "\\.rule$");
this->AddSourceGroup("Resources", "\\.plist$");
this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
+
+ this->ObjectLibrariesSourceGroupIndex = this->SourceGroups.size();
+ this->SourceGroups.push_back(
+ cmSourceGroup("Object Libraries", "^MATCH_NO_SOURCES$"));
#endif
}
@@ -3124,6 +3128,18 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
return this->CreateSource(sourceName, generated);
}
+void cmMakefile::AddTargetObject(std::string const& tgtName,
+ std::string const& objFile)
+{
+ cmSourceFile* sf = this->GetOrCreateSource(objFile, true);
+ sf->SetObjectLibrary(tgtName);
+ sf->SetProperty("EXTERNAL_OBJECT", "1");
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ this->SourceGroups[this->ObjectLibrariesSourceGroupIndex].AddGroupFile(
+ sf->GetFullPath());
+#endif
+}
+
void cmMakefile::EnableLanguage(std::vector<std::string> const& lang,
bool optional)
{