1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
-- license:BSD-3-Clause
-- copyright-holders:MAMEdev Team,Jeffrey Clark
local extlibs = {
--
-- 3rdparty system 3rdparty
-- lib name: lib name, include dir
--
asio = { "asio", "3rdparty/asio/include" },
expat = { "expat", "3rdparty/expat/lib" },
zlib = { "z", "3rdparty/zlib" },
zstd = { "zstd", "3rdparty/zstd/lib" },
jpeg = { "jpeg", "3rdparty/libjpeg" },
flac = { "FLAC", "3rdparty/flac/include" },
sqlite3 = { "sqlite3", "3rdparty/sqlite3" },
portmidi = { "portmidi", "3rdparty/portmidi/pm_common" },
portaudio = { "portaudio", "3rdparty/portaudio/include" },
lua = { "lua", "3rdparty/lua/src" },
utf8proc = { "utf8proc", "3rdparty/utf8proc" },
glm = { "glm", "3rdparty/glm" },
rapidjson = { "rapidjson", "3rdparty/rapidjson/include" },
pugixml = { "pugixml", "3rdparty/pugixml/src" },
}
-- system lib options
newoption {
trigger = 'with-system-asio',
description = 'Use system Asio library',
}
newoption {
trigger = 'with-system-expat',
description = 'Use system Expat library',
}
newoption {
trigger = 'with-system-zlib',
description = 'Use system Zlib library',
}
newoption {
trigger = 'with-system-zstd',
description = 'Use system Zstandard library',
}
newoption {
trigger = 'with-system-jpeg',
description = 'Use system JPEG library',
}
newoption {
trigger = 'with-system-flac',
description = 'Use system FLAC library',
}
newoption {
trigger = 'with-system-sqlite3',
description = 'Use system SQLite library',
}
newoption {
trigger = 'with-system-portmidi',
description = 'Use system PortMidi library',
}
newoption {
trigger = 'with-system-portaudio',
description = 'Use system PortAudio library',
}
newoption {
trigger = "with-system-lua",
description = "Use system LUA library",
}
newoption {
trigger = "with-system-utf8proc",
description = "Use system utf8proc library",
}
newoption {
trigger = "with-system-glm",
description = "Use system glm library",
}
newoption {
trigger = "with-system-rapidjson",
description = "Use system rapidjson library",
}
newoption {
trigger = "with-system-pugixml",
description = "Use system pugixml library",
}
-- 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
default = ""
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
local y = x[idx]:explode(",")
if y[1]~=nil then
found = y
else
found = x[idx]
end
end
end
return found
end
|