mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
try using pkg-config for freetype2 as well
This commit is contained in:
parent
b3981fb74c
commit
9e5435d920
|
@ -4,11 +4,15 @@ FreeType = {
|
||||||
OptFind = function (name, required)
|
OptFind = function (name, required)
|
||||||
local check = function(option, settings)
|
local check = function(option, settings)
|
||||||
option.value = false
|
option.value = false
|
||||||
|
option.use_pkgconfig = false
|
||||||
option.use_ftconfig = false
|
option.use_ftconfig = false
|
||||||
option.use_winlib = 0
|
option.use_winlib = 0
|
||||||
option.lib_path = nil
|
option.lib_path = nil
|
||||||
|
|
||||||
if ExecuteSilent("freetype-config") > 0 and ExecuteSilent("freetype-config --cflags") == 0 then
|
if ExecuteSilent("pkg-config freetype2") == 0 then
|
||||||
|
option.value = true
|
||||||
|
option.use_pkgconfig = true
|
||||||
|
elseif ExecuteSilent("freetype-config") > 0 and ExecuteSilent("freetype-config --cflags") == 0 then
|
||||||
option.value = true
|
option.value = true
|
||||||
option.use_ftconfig = true
|
option.use_ftconfig = true
|
||||||
end
|
end
|
||||||
|
@ -23,7 +27,10 @@ FreeType = {
|
||||||
end
|
end
|
||||||
|
|
||||||
local apply = function(option, settings)
|
local apply = function(option, settings)
|
||||||
if option.use_ftconfig == true then
|
if option.use_pkgconfig == true then
|
||||||
|
settings.cc.flags:Add("`pkg-config --cflags freetype2`")
|
||||||
|
settings.link.flags:Add("`pkg-config --libs freetype2`")
|
||||||
|
elseif option.use_ftconfig == true then
|
||||||
settings.cc.flags:Add("`freetype-config --cflags`")
|
settings.cc.flags:Add("`freetype-config --cflags`")
|
||||||
settings.link.flags:Add("`freetype-config --libs`")
|
settings.link.flags:Add("`freetype-config --libs`")
|
||||||
elseif option.use_winlib > 0 then
|
elseif option.use_winlib > 0 then
|
||||||
|
@ -39,12 +46,14 @@ FreeType = {
|
||||||
|
|
||||||
local save = function(option, output)
|
local save = function(option, output)
|
||||||
output:option(option, "value")
|
output:option(option, "value")
|
||||||
|
output:option(option, "use_pkgconfig")
|
||||||
output:option(option, "use_ftconfig")
|
output:option(option, "use_ftconfig")
|
||||||
output:option(option, "use_winlib")
|
output:option(option, "use_winlib")
|
||||||
end
|
end
|
||||||
|
|
||||||
local display = function(option)
|
local display = function(option)
|
||||||
if option.value == true then
|
if option.value == true then
|
||||||
|
if option.use_pkgconfig == true then return "using pkg-config" end
|
||||||
if option.use_ftconfig == true then return "using freetype-config" end
|
if option.use_ftconfig == true then return "using freetype-config" end
|
||||||
if option.use_winlib == 32 then return "using supplied win32 libraries" end
|
if option.use_winlib == 32 then return "using supplied win32 libraries" end
|
||||||
if option.use_winlib == 64 then return "using supplied win64 libraries" end
|
if option.use_winlib == 64 then return "using supplied win64 libraries" end
|
||||||
|
|
Loading…
Reference in a new issue