From 902f3763af4931c5c04c47d10e4d24dba96487cd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Jun 2015 17:27:25 +0200 Subject: Move path_mtime to filesystem, rename file_mtime, follow symlinks --- build/search.cxx | 4 +++- build/target | 8 ++++---- build/target.cxx | 11 ++++++++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/build/search.cxx b/build/search.cxx index ee6e20f..feff123 100644 --- a/build/search.cxx +++ b/build/search.cxx @@ -7,6 +7,8 @@ #include // move() #include +#include + #include #include #include @@ -78,7 +80,7 @@ namespace build f += e; } - timestamp mt (path_mtime (f)); + timestamp mt (file_mtime (f)); if (mt == timestamp_nonexistent) continue; diff --git a/build/target b/build/target index 9388065..54b9daf 100644 --- a/build/target +++ b/build/target @@ -520,10 +520,6 @@ namespace build const char* name_prefix = nullptr, const char* name_suffix = nullptr); - protected: - virtual timestamp - load_mtime () const; - public: static const target_type static_type; @@ -538,6 +534,10 @@ namespace build public: using path_target::path_target; + protected: + virtual timestamp + load_mtime () const; + public: virtual const target_type& type () const {return static_type;} static const target_type static_type; diff --git a/build/target.cxx b/build/target.cxx index 3810092..1040443 100644 --- a/build/target.cxx +++ b/build/target.cxx @@ -4,6 +4,8 @@ #include +#include + #include #include #include @@ -268,11 +270,14 @@ namespace build return dir / path_type (move (n)); } - timestamp path_target:: + // file_target + // + timestamp file:: load_mtime () const { - assert (!path_.empty ()); - return path_mtime (path_); + const path_type& f (path ()); + assert (!f.empty ()); + return file_mtime (f); } // Search functions. -- cgit v1.1