2016-03-28 19:09:19 +02:00
|
|
|
-- license:BSD-3-Clause
|
|
|
|
-- copyright-holders:MAMEdev Team,Jeffrey Clark
|
|
|
|
|
|
|
|
local extlibs = {
|
|
|
|
--
|
|
|
|
-- 3rdparty system 3rdparty
|
|
|
|
-- lib name: lib name, include dir
|
|
|
|
--
|
2018-02-24 15:34:04 +01:00
|
|
|
asio = { "asio", "3rdparty/asio/include" },
|
2016-03-28 19:09:19 +02:00
|
|
|
expat = { "expat", "3rdparty/expat/lib" },
|
|
|
|
zlib = { "z", "3rdparty/zlib" },
|
|
|
|
jpeg = { "jpeg", "3rdparty/libjpeg" },
|
2016-03-29 09:45:53 +02:00
|
|
|
flac = { "FLAC", "3rdparty/libflac/include" },
|
2016-11-07 16:12:06 +01:00
|
|
|
sqlite3 = { "sqlite3", "3rdparty/sqlite3" },
|
2016-03-28 19:09:19 +02:00
|
|
|
portmidi = { "portmidi", "3rdparty/portmidi/pm_common" },
|
|
|
|
portaudio = { "portaudio", "3rdparty/portaudio/include" },
|
|
|
|
lua = { "lua", "3rdparty/lua/src" },
|
2017-01-25 22:35:24 +01:00
|
|
|
utf8proc = { "utf8proc", "3rdparty/utf8proc" },
|
2018-02-08 22:06:25 +01:00
|
|
|
glm = { "glm", "3rdparty/glm" },
|
|
|
|
rapidjson = { "rapidjson", "3rdparty/rapidjson/include" },
|
2018-03-18 15:30:55 +01:00
|
|
|
pugixml = { "pugixml", "3rdparty/pugixml/src" },
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
-- system lib options
|
2018-02-08 22:06:25 +01:00
|
|
|
newoption {
|
|
|
|
trigger = 'with-system-asio',
|
|
|
|
description = 'Use system Asio library',
|
|
|
|
}
|
|
|
|
|
2016-03-28 19:09:19 +02:00
|
|
|
newoption {
|
2016-03-29 08:49:47 +02:00
|
|
|
trigger = 'with-system-expat',
|
|
|
|
description = 'Use system Expat library',
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
newoption {
|
2016-03-29 08:49:47 +02:00
|
|
|
trigger = 'with-system-zlib',
|
|
|
|
description = 'Use system Zlib library',
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
newoption {
|
2016-03-29 08:49:47 +02:00
|
|
|
trigger = 'with-system-jpeg',
|
|
|
|
description = 'Use system JPEG library',
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
newoption {
|
2016-03-29 08:49:47 +02:00
|
|
|
trigger = 'with-system-flac',
|
|
|
|
description = 'Use system FLAC library',
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
2016-11-07 16:12:06 +01:00
|
|
|
newoption {
|
|
|
|
trigger = 'with-system-sqlite3',
|
|
|
|
description = 'Use system SQLite library',
|
|
|
|
}
|
|
|
|
|
2016-03-28 19:09:19 +02:00
|
|
|
newoption {
|
2016-03-29 08:49:47 +02:00
|
|
|
trigger = 'with-system-portmidi',
|
|
|
|
description = 'Use system PortMidi library',
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
newoption {
|
2016-03-29 08:49:47 +02:00
|
|
|
trigger = 'with-system-portaudio',
|
|
|
|
description = 'Use system PortAudio library',
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
newoption {
|
2016-03-29 08:49:47 +02:00
|
|
|
trigger = "with-system-lua",
|
|
|
|
description = "Use system LUA library",
|
2016-03-28 19:09:19 +02:00
|
|
|
}
|
|
|
|
|
2017-01-25 22:35:24 +01:00
|
|
|
newoption {
|
|
|
|
trigger = "with-system-utf8proc",
|
|
|
|
description = "Use system utf8proc library",
|
|
|
|
}
|
|
|
|
|
2018-02-08 22:06:25 +01:00
|
|
|
newoption {
|
|
|
|
trigger = "with-system-glm",
|
|
|
|
description = "Use system glm library",
|
|
|
|
}
|
|
|
|
|
|
|
|
newoption {
|
|
|
|
trigger = "with-system-rapidjson",
|
|
|
|
description = "Use system rapidjson library",
|
|
|
|
}
|
|
|
|
|
2018-03-18 15:30:55 +01:00
|
|
|
newoption {
|
|
|
|
trigger = "with-system-pugixml",
|
|
|
|
description = "Use system pugixml library",
|
|
|
|
}
|
|
|
|
|
2016-03-28 19:09:19 +02:00
|
|
|
-- build helpers
|
|
|
|
function ext_lib(lib)
|
|
|
|
local opt = _OPTIONS["with-system-" .. lib]
|
|
|
|
if (opt~=nil and opt=="1") then
|
|
|
|
default = extlibs[lib][1]
|
|
|
|
else
|
|
|
|
default = lib
|
|
|
|
end
|
|
|
|
return ext_best(lib, default, 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
function ext_includedir(lib)
|
|
|
|
local opt = _OPTIONS["with-system-" .. lib]
|
|
|
|
if (opt==nil or opt=="0") then
|
|
|
|
-- using bundled, prepend MAME_DIR
|
|
|
|
default = MAME_DIR .. extlibs[lib][2]
|
|
|
|
else
|
2016-03-29 05:57:13 +02:00
|
|
|
default = ""
|
2016-03-28 19:09:19 +02:00
|
|
|
end
|
|
|
|
return ext_best(lib, default, 2)
|
|
|
|
end
|
|
|
|
|
|
|
|
function ext_best(lib, default, idx)
|
|
|
|
local opt = _OPTIONS["with-system-" .. lib]
|
|
|
|
local found = default
|
|
|
|
if (opt~=nil and opt~="0" and opt~="1") then
|
|
|
|
-- override default if provided (format <libname:includedir>)
|
|
|
|
local x = opt:explode(":")
|
|
|
|
if x[idx]~=nil then
|
2016-03-29 06:07:14 +02:00
|
|
|
local y = x[idx]:explode(",")
|
|
|
|
if y[1]~=nil then
|
|
|
|
found = y
|
|
|
|
else
|
|
|
|
found = x[idx]
|
|
|
|
end
|
2016-03-28 19:09:19 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
return found
|
|
|
|
end
|