From 55ddc71fd801e06115ad6e33098b0eed2517daab Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Nov 2019 13:16:21 +0200 Subject: Add support for automatic importing of libbuild2 of installed case --- libbuild2/cc/common.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'libbuild2/cc/common.cxx') diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index f14f973..587ae08 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -786,13 +786,28 @@ namespace build2 return a != nullptr || s != nullptr; }; - // First try user directories (i.e., -L). + // First try user directories (i.e., -L or /LIBPATH). // bool sys (false); if (!usrd) + { usrd = extract_library_dirs (*p.scope); + // Handle automatic importing of installed build2 libraries. This is a + // mirror side of the uninstalled case that is handled via the special + // import.build2 value in import_search(). + // + if (build_installed && p.proj && *p.proj == "build2") + { + // Note that we prepend it to other user directories instead of + // making it the only one to allow things to be overriden (e.g., if + // build2 was moved or some such). + // + usrd->insert (usrd->begin (), build_install_lib); + } + } + const dir_path* pd (nullptr); for (const dir_path& d: *usrd) { -- cgit v1.1