diff options
author | Marius Kintel <marius@kintel.net> | 2014-02-10 07:19:56 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2014-02-10 07:19:56 (GMT) |
commit | 6f4cf3ebecdd720ed31c0257543fd071f41afc17 (patch) | |
tree | 6344dcd48870c672f809230c7a2a89d511b7a29a /src/ModuleCache.cc | |
parent | e4daa42cf6c376e1e27166bb4a1bca234866c10a (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.cc | 17 |
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() |