1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.pkgconfig: handle paths to local .pc files too (needed for homebrew) (#8290)

This commit is contained in:
R cqls 2021-01-23 12:09:53 +01:00 committed by GitHub
parent ba2a15c9d7
commit 749d6133a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,6 +136,11 @@ fn (mut pc PkgConfig) parse(file string) bool {
} }
fn (mut pc PkgConfig) resolve(pkgname string) ?string { fn (mut pc PkgConfig) resolve(pkgname string) ?string {
if pkgname.ends_with('.pc') {
if os.exists(pkgname) {
return pkgname
}
} else {
if pc.paths.len == 0 { if pc.paths.len == 0 {
pc.paths << '.' pc.paths << '.'
} }
@ -145,6 +150,7 @@ fn (mut pc PkgConfig) resolve(pkgname string) ?string {
return file return file
} }
} }
}
return error('Cannot find "$pkgname" pkgconfig file') return error('Cannot find "$pkgname" pkgconfig file')
} }