aboutsummaryrefslogtreecommitdiff
path: root/build2/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-19 17:10:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-19 17:10:51 +0200
commit89a9f8174ec858bf6df8515a84f061f211dec551 (patch)
tree030daad1364ea38a4f2ec22c57b41aeeb8b1b6e8 /build2/rule.cxx
parent3ec07c196c9ab86db09c77bff7eb11cd5a5a9b1e (diff)
Add import library target libi{}, make libs{} the DLL
In the end, having libs{} be the DLL with import library being its member is more natural than making libs{} the import library and having dll{} as its member.
Diffstat (limited to 'build2/rule.cxx')
-rw-r--r--build2/rule.cxx29
1 files changed, 18 insertions, 11 deletions
diff --git a/build2/rule.cxx b/build2/rule.cxx
index cbb7d08..0fcfde2 100644
--- a/build2/rule.cxx
+++ b/build2/rule.cxx
@@ -44,18 +44,25 @@ namespace build2
{
path_target& pt (dynamic_cast<path_target&> (t));
- // Assign the path. While normally we shouldn't do this in match(),
- // no other rule should ever be ambiguous with the fallback one.
+ // First check the timestamp. This allows for the special "trust me,
+ // this file exists" situations (used, for example, for installed
+ // stuff where we know it's there, just not exactly where).
//
- if (pt.path ().empty ())
- pt.derive_path ();
-
- // We cannot just call pt.mtime() since we haven't matched yet.
- //
- timestamp ts (file_mtime (pt.path ()));
- pt.mtime (ts);
-
- if (ts != timestamp_nonexistent)
+ timestamp ts (pt.mtime ());
+
+ if (ts == timestamp_unknown)
+ {
+ // Assign the path. While normally we shouldn't do this in match(),
+ // no other rule should ever be ambiguous with the fallback one.
+ //
+ if (pt.path ().empty ())
+ {
+ pt.derive_path ();
+ ts = pt.mtime ();
+ }
+ }
+
+ if (ts != timestamp_unknown && ts != timestamp_nonexistent)
return t;
l4 ([&]{trace << "no existing file for target " << t;});