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