summaryrefslogtreecommitdiff
path: root/src/ModuleCache.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2014-02-10 07:19:56 (GMT)
committerMarius Kintel <marius@kintel.net>2014-02-10 07:19:56 (GMT)
commit6f4cf3ebecdd720ed31c0257543fd071f41afc17 (patch)
tree6344dcd48870c672f809230c7a2a89d511b7a29a /src/ModuleCache.cc
parente4daa42cf6c376e1e27166bb4a1bca234866c10a (diff)
Fixed a bug failing to detect changes in underlying libraries. Should improve some of the issues reported in #181
Diffstat (limited to 'src/ModuleCache.cc')
-rw-r--r--src/ModuleCache.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/ModuleCache.cc b/src/ModuleCache.cc
index 595a463..d79a026 100644
--- a/src/ModuleCache.cc
+++ b/src/ModuleCache.cc
@@ -22,12 +22,16 @@
ModuleCache *ModuleCache::inst = NULL;
/*!
- Reevaluate the given file and recompile if necessary.
- Returns NULL on any error (e.g. compile error or file not found)
-
+ Reevaluate the given file and all it's dependencies and recompile anything
+ needing reevaluation.
The given filename must be absolute.
+
+ Sets the module reference to the new modile, or NULL on any error (e.g. compile
+ error or file not found)
+
+ Returns true if anything was compiled (module or dependencies) and false otherwise.
*/
-FileModule *ModuleCache::evaluate(const std::string &filename)
+bool ModuleCache::evaluate(const std::string &filename, FileModule *&module)
{
FileModule *lib_mod = NULL;
bool found = false;
@@ -115,9 +119,10 @@ FileModule *ModuleCache::evaluate(const std::string &filename)
print_messages_pop();
}
- if (lib_mod) lib_mod->handleDependencies();
+ module = lib_mod;
+ bool depschanged = lib_mod ? lib_mod->handleDependencies() : false;
- return lib_mod;
+ return shouldCompile || depschanged;
}
void ModuleCache::clear()
contact: Jan Huwald // Impressum