Do not ask for location of missing library if its prefix is supposed to be ignored.
This commit is contained in:
parent
84440587e1
commit
11ac86e086
|
@ -135,7 +135,8 @@ Dependency::Dependency(std::string path)
|
|||
}
|
||||
|
||||
//If the location is still unknown, ask the user for search path
|
||||
if( prefix.empty() || !fileExists( prefix+filename ) )
|
||||
if( !Settings::isPrefixIgnored(prefix)
|
||||
&& ( prefix.empty() || !fileExists( prefix+filename ) ) )
|
||||
{
|
||||
std::cerr << "\n/!\\ WARNING : Library " << filename << " has an incomplete name (location unknown)" << std::endl;
|
||||
missing_prefixes = true;
|
||||
|
|
|
@ -76,19 +76,25 @@ void ignore_prefix(std::string prefix)
|
|||
prefixes_to_ignore.push_back(prefix);
|
||||
}
|
||||
|
||||
bool isPrefixIgnored(std::string prefix)
|
||||
{
|
||||
const int prefix_amount = prefixes_to_ignore.size();
|
||||
for(int n=0; n<prefix_amount; n++)
|
||||
{
|
||||
if(prefix.compare(prefixes_to_ignore[n]) == 0) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isPrefixBundled(std::string prefix)
|
||||
{
|
||||
if(prefix.find(".framework") != std::string::npos) return false;
|
||||
if(prefix.find("@executable_path") != std::string::npos) return false;
|
||||
if(prefix.compare("/usr/lib/") == 0) return false;
|
||||
|
||||
const int prefix_amount = prefixes_to_ignore.size();
|
||||
for(int n=0; n<prefix_amount; n++)
|
||||
{
|
||||
if(prefix.compare(prefixes_to_ignore[n]) == 0) return false;
|
||||
}
|
||||
if(isPrefixIgnored(prefix)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace Settings
|
|||
{
|
||||
|
||||
bool isPrefixBundled(std::string prefix);
|
||||
bool isPrefixIgnored(std::string prefix);
|
||||
void ignore_prefix(std::string prefix);
|
||||
|
||||
bool canOverwriteFiles();
|
||||
|
@ -56,4 +57,4 @@ std::string inside_lib_path();
|
|||
void inside_lib_path(std::string p);
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue