From a4796d5b851dac4a546f89c282f65e320076eb10 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 27 Aug 2016 09:53:30 +0200 Subject: Clean up library export, make c and cxx modules project root only So now c and cxx modules can only be loaded in project root scope (normally root.build). Also, the c.std and cxx.std must now be set *before* loading the module to take effect. This means we won't be able to handle old buildfiles anymore but old versions of build2 should be able to handle new *.std placement. --- build2/cc/pkgconfig.cxx | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'build2/cc/pkgconfig.cxx') diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx index 2122ea5..eb7f0a6 100644 --- a/build2/cc/pkgconfig.cxx +++ b/build2/cc/pkgconfig.cxx @@ -41,12 +41,11 @@ namespace build2 const string* proj, const string& stem, const dir_path& libd, - optional& sys_sp, + const dir_paths& sysd, lorder lo) const { tracer trace (x, "link::pkgconfig_extract"); - assert (sys_sp); assert (pkgconfig != nullptr); // Check if we have the pkgconfig/ subdirectory in this library's @@ -291,15 +290,15 @@ namespace build2 // The reason we do it is the link order. For general libraries it // shouldn't matter if we imported them via an export stub, direct // import installed, or via a .pc file (which we could have generated - // from the export stub). The exception is "system libraries" (which + // from the export stub). The exception is "runtime libraries" (which // are really the extension of libc) such as -lm, -ldl, -lpthread, // etc. Those we will detect and leave as -l*. // - // If we managed to resolve all the -l's (sans system), then we can + // If we managed to resolve all the -l's (sans runtime), then we can // omit -L's for nice and tidy command line. // bool all (true); - optional sp; // Populate lazily. + optional usrd; // Populate lazily. for (name& n: libs) { @@ -333,15 +332,13 @@ namespace build2 continue; } - // Prepare the search paths. + // Prepare user search paths by entering the -L paths from the .pc + // file. // - if (have_L && !sp) + if (have_L && !usrd) { - sp = dir_paths (); + usrd = dir_paths (); - // First enter the -L paths from the .pc file so that they take - // precedence. - // for (auto i (lops.begin ()); i != lops.end (); ++i) { const string& o (*i); @@ -361,13 +358,9 @@ namespace build2 fail << "relative -L directory in '" << lstr << "'" << info << "while parsing pkg-config --libs output of " << f; - sp->push_back (move (d)); + usrd->push_back (move (d)); } } - - // Then append system paths. - // - sp->insert (sp->end (), sys_sp->begin (), sys_sp->end ()); } // @@ OUT: for now we assume out is undetermined, just like in @@ -381,7 +374,7 @@ namespace build2 nullptr, {&lib::static_type, &out, &out, &name, ext}, &s}; if (lib* lt = static_cast ( - search_library (have_L ? sp : sys_sp, pk, lo))) + search_library (sysd, usrd, pk, lo))) { file& f (static_cast (link_member (*lt, lo))); l = f.path ().string (); -- cgit v1.1