[Linux] Fix pkg-config trailing space causing premake to output an extra empty library -l

Fixes #1868
This commit is contained in:
Jonathan Goyvaerts 2021-07-21 16:32:58 +02:00 committed by Rick Gibbed
parent a7efdd9ed8
commit 48bb93a9ca
1 changed files with 3 additions and 1 deletions

View File

@ -24,8 +24,10 @@ function pkg_config.lflags(lib)
local output = ({os.outputof("pkg-config --libs-only-l "..lib)})[1]
for k, flag in next, string.explode(output, " ") do
-- remove "-l"
if flag ~= "" then
links(string.sub(flag, 3))
end
end
end
function pkg_config.all(lib)