summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-04-13 18:55:37 +0200
committerMichael Stahl <mstahl@redhat.com>2012-04-14 21:07:13 +0200
commit8c0a9bca425bffd87d12c3f18ec852f083c11bef (patch)
tree4a85856bcb14d1b8fb98cb207b872263044bbddf /idlc
parentd3b74479a7d0f6f02c86e72be14ae3880726ce59 (diff)
idlc: make dependencies: handle removed include files:
Write dummy targets for included files, so the incremental build does not break with "No rule to make target" if the included file is removed.
Diffstat (limited to 'idlc')
-rw-r--r--idlc/source/idlc.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx
index 449de35a6835..4d15b2fec1fb 100644
--- a/idlc/source/idlc.cxx
+++ b/idlc/source/idlc.cxx
@@ -313,6 +313,21 @@ struct WriteDep
}
};
+// write a dummy target for one included file, so the incremental build does
+// not break with "No rule to make target" if the included file is removed
+struct WriteDummy
+{
+ ::osl::File& m_rFile;
+ ::osl::FileBase::RC & m_rRC;
+ explicit WriteDummy(::osl::File & rFile, ::osl::FileBase::RC & rRC)
+ : m_rFile(rFile), m_rRC(rRC) { }
+ void operator() (::rtl::OString const& rEntry)
+ {
+ lcl_writeString(m_rFile, m_rRC, rEntry);
+ lcl_writeString(m_rFile, m_rRC, ":\n\n");
+ }
+};
+
bool
Idlc::dumpDeps(::rtl::OString const& rDepFile, ::rtl::OString const& rTarget)
{
@@ -334,6 +349,9 @@ Idlc::dumpDeps(::rtl::OString const& rDepFile, ::rtl::OString const& rTarget)
m_includes.erase(getRealFileName()); // eeek, that is a temp file...
::std::for_each(m_includes.begin(), m_includes.end(),
WriteDep(depFile, rc));
+ lcl_writeString(depFile, rc, "\n\n");
+ ::std::for_each(m_includes.begin(), m_includes.end(),
+ WriteDummy(depFile, rc));
if (::osl::FileBase::E_None != rc) {
return false;
}