diff options
| author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-10-15 16:01:16 +0900 |
|---|---|---|
| committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-10-15 16:01:16 +0900 |
| commit | 6ce977d00542b689fae703311faca1766e30b286 (patch) | |
| tree | e3f5a665c444ec0b855b90e9740da1cfba4b7527 /ninja.cc | |
| parent | 9c5ec1d44238c033ab9cac37e56833447c422338 (diff) | |
[C++] Regenerate ninja files when symlink was changed
Diffstat (limited to 'ninja.cc')
| -rw-r--r-- | ninja.cc | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -931,8 +931,21 @@ bool NeedsRegen(double start_time, const string& orig_args) { // directory which affects the results of find command. if (s == "" || s == "." || ShouldIgnoreDirty(s)) continue; - double ts = GetTimestamp(s); - should_run_command |= (ts < 0 || gen_time < ts); + + struct stat st; + if (lstat(s.c_str(), &st) != 0) { + should_run_command = true; + continue; + } + double ts = GetTimestampFromStat(st); + if (gen_time < ts) { + should_run_command = true; + continue; + } + if (S_ISLNK(st.st_mode)) { + ts = GetTimestamp(s); + should_run_command |= (ts < 0 || gen_time < ts); + } } if (!should_run_command) { |
