From 89a9f8174ec858bf6df8515a84f061f211dec551 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Jul 2016 17:10:51 +0200 Subject: 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. --- build2/rule.cxx | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'build2/rule.cxx') 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 (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;}); -- cgit v1.1