diff --git a/ppremake/ppDependableFile.cxx b/ppremake/ppDependableFile.cxx index 3c3d298605..5258907717 100644 --- a/ppremake/ppDependableFile.cxx +++ b/ppremake/ppDependableFile.cxx @@ -239,6 +239,7 @@ get_dependency(int n) { void PPDependableFile:: get_complete_dependencies(vector &files) { set files_set; + get_complete_dependencies(files_set); copy(files_set.begin(), files_set.end(), back_inserter(files)); sort(files.begin(), files.end(), SortDependableFilesByName()); diff --git a/ppremake/ppMain.cxx b/ppremake/ppMain.cxx index 565fbe34f8..813193f486 100644 --- a/ppremake/ppMain.cxx +++ b/ppremake/ppMain.cxx @@ -172,6 +172,14 @@ process_all() { //////////////////////////////////////////////////////////////////// bool PPMain:: process(const string &dirname) { + string cache_filename = _def_scope->expand_variable("DEPENDENCY_CACHE_FILENAME"); + + if (cache_filename.empty()) { + cerr << "Warning: no definition given for $[DEPENDENCY_CACHE_FILENAME].\n"; + } else { + _tree.read_file_dependencies(cache_filename); + } + PPDirectory *dir = _tree.find_dirname(dirname); if (dir == (PPDirectory *)NULL) { cerr << "Unknown directory: " << dirname << "\n"; @@ -183,7 +191,15 @@ process(const string &dirname) { return false; } - return p_process(dir); + if (!p_process(dir)) { + return false; + } + + if (!cache_filename.empty()) { + _tree.update_file_dependencies(cache_filename); + } + + return true; } ////////////////////////////////////////////////////////////////////