#include <limits>
#include <msp/core/algorithm.h>
+#include <msp/core/environ.h>
#include <msp/io/print.h>
#include <msp/strings/utils.h>
#include "binarypackage.h"
{
vector<FS::Path> bases;
+ for(const string &e: env_hints)
+ {
+ string env_value = getenv(e);
+ if(!env_value.empty())
+ bases.push_back(env_value);
+ }
+
/* If we have any relative paths that need resolving, or we have no paths at
all and are not using pkg-config, look for files in prefix */
if(relative_paths || (!use_pkgconfig && export_binfo.libpath.empty() && export_binfo.incpath.empty()))
DataFile::DerivedObjectLoader<BinaryPackage, Package::Loader>(p)
{
add("build_info", &Loader::build_info);
+ add("env_hint", &Loader::env_hint);
add("header", &Loader::header);
}
load_sub(obj.export_binfo);
}
+void BinaryPackage::Loader::env_hint(const string &e)
+{
+ obj.env_hints.push_back(e);
+}
+
void BinaryPackage::Loader::header(const string &h)
{
obj.headers.push_back(h);
Loader(BinaryPackage &);
private:
void build_info();
+ void env_hint(const std::string &);
void header(const std::string &);
};
using Flags = std::vector<std::string>;
private:
+ std::vector<std::string> env_hints;
bool relative_paths = false;
bool found_on_system = false;
Msp::FS::Path base_path;