diff --git a/3rdparty/libjpeg/jpeglib.h b/3rdparty/libjpeg/jpeglib.h index be8fd64ef91..1eb1fac033f 100644 --- a/3rdparty/libjpeg/jpeglib.h +++ b/3rdparty/libjpeg/jpeglib.h @@ -11,13 +11,6 @@ * and perhaps jerror.h if they want to know the exact error codes. */ -#ifdef USE_SYSTEM_JPEGLIB -#ifndef XMD_H -#define XMD_H -#endif -#include -#else - #ifndef JPEGLIB_H #define JPEGLIB_H @@ -1165,4 +1158,3 @@ struct jpeg_color_quantizer { long dummy; }; #endif #endif /* JPEGLIB_H */ -#endif /* USE_SYSTEM_JPEGLIB */ diff --git a/3rdparty/lsqlite3/lsqlite3.c b/3rdparty/lsqlite3/lsqlite3.c index 072d33b59eb..3f1216f1d93 100644 --- a/3rdparty/lsqlite3/lsqlite3.c +++ b/3rdparty/lsqlite3/lsqlite3.c @@ -31,8 +31,8 @@ #include #define LUA_LIB -#include "lua.h" -#include "lauxlib.h" +#include +#include #if LUA_VERSION_NUM > 501 // @@ -47,11 +47,7 @@ #define luaL_openlib(L,name,reg,nup) luaL_setfuncs(L,reg,nup) #endif -#ifndef USE_SYSTEM_SQLITE -#include "sqlite3/sqlite3.h" -#else #include -#endif /* compile time features */ #if !defined(SQLITE_OMIT_PROGRESS_CALLBACK) diff --git a/makefile b/makefile index 29eb6c018cc..f9f6c2f4032 100644 --- a/makefile +++ b/makefile @@ -376,36 +376,36 @@ endif # which 3rdparty library to build; # link against system (common) library otherwise #------------------------------------------------- -ifndef USE_SYSTEM_LIB_EXPAT -PARAMS += --with-bundled-expat +ifdef USE_SYSTEM_LIB_EXPAT +PARAMS += --with-system-expat='$(USE_SYSTEM_LIB_EXPAT)' endif -ifndef USE_SYSTEM_LIB_ZLIB -PARAMS += --with-bundled-zlib +ifdef USE_SYSTEM_LIB_ZLIB +PARAMS += --with-system-zlib='$(USE_SYSTEM_LIB_ZLIB)' endif -ifndef USE_SYSTEM_LIB_JPEG -PARAMS += --with-bundled-jpeg +ifdef USE_SYSTEM_LIB_JPEG +PARAMS += --with-system-jpeg='$(USE_SYSTEM_LIB_JPEG)' endif -ifndef USE_SYSTEM_LIB_FLAC -PARAMS += --with-bundled-flac +ifdef USE_SYSTEM_LIB_FLAC +PARAMS += --with-system-flac='$(USE_SYSTEM_LIB_FLAC)' endif -ifndef USE_SYSTEM_LIB_LUA -PARAMS += --with-bundled-lua +ifdef USE_SYSTEM_LIB_LUA +PARAMS += --with-system-lua='$(USE_SYSTEM_LIB_LUA)' endif -ifndef USE_SYSTEM_LIB_SQLITE3 -PARAMS += --with-bundled-sqlite3 +ifdef USE_SYSTEM_LIB_SQLITE3 +PARAMS += --with-system-sqlite3='$(USE_SYSTEM_LIB_SQLITE3)' endif -ifndef USE_SYSTEM_LIB_PORTMIDI -PARAMS += --with-bundled-portmidi +ifdef USE_SYSTEM_LIB_PORTMIDI +PARAMS += --with-system-portmidi='$(USE_SYSTEM_LIB_PORTMIDI)' endif -ifndef USE_SYSTEM_LIB_PORTAUDIO -PARAMS += --with-bundled-portaudio +ifdef USE_SYSTEM_LIB_PORTAUDIO +PARAMS += --with-system-portaudio='$(USE_SYSTEM_LIB_PORTAUDIO)' endif # reverse logic for this one @@ -414,8 +414,8 @@ ifdef USE_BUNDLED_LIB_SDL2 PARAMS += --with-bundled-sdl2 endif -ifndef USE_SYSTEM_LIB_UV -PARAMS += --with-bundled-libuv +ifdef USE_SYSTEM_LIB_UV +PARAMS += --with-system-uv='$(USE_SYSTEM_LIB_UV)' endif #------------------------------------------------- diff --git a/scripts/extlib.lua b/scripts/extlib.lua new file mode 100644 index 00000000000..bd80c8b74b8 --- /dev/null +++ b/scripts/extlib.lua @@ -0,0 +1,104 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team,Jeffrey Clark + +local extlibs = { +-- +-- 3rdparty system 3rdparty +-- lib name: lib name, include dir +-- + expat = { "expat", "3rdparty/expat/lib" }, + zlib = { "z", "3rdparty/zlib" }, + jpeg = { "jpeg", "3rdparty/libjpeg" }, + flac = { "FLAC", "3rdparty/libflac/include" }, + sqlite3 = { "sqlite3", "3rdparty/sqlite3" }, + portmidi = { "portmidi", "3rdparty/portmidi/pm_common" }, + portaudio = { "portaudio", "3rdparty/portaudio/include" }, + lua = { "lua", "3rdparty/lua/src" }, + uv = { "uv" , "3rdparty/libuv/include" }, +} + +-- system lib options +newoption { + trigger = 'with-system-expat', + description = 'Use system Expat library', +} + +newoption { + trigger = 'with-system-zlib', + description = 'Use system Zlib 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-uv', + description = 'Use system uv 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 ) + 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 diff --git a/scripts/genie.lua b/scripts/genie.lua index 219b493f135..88af2217c8f 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -119,56 +119,11 @@ newoption { }, } -newoption { - trigger = 'with-bundled-expat', - description = 'Build bundled Expat library', -} - -newoption { - trigger = 'with-bundled-zlib', - description = 'Build bundled Zlib library', -} - -newoption { - trigger = 'with-bundled-jpeg', - description = 'Build bundled JPEG library', -} - -newoption { - trigger = 'with-bundled-flac', - description = 'Build bundled FLAC library', -} - -newoption { - trigger = 'with-bundled-lua', - description = 'Build bundled LUA library', -} - -newoption { - trigger = 'with-bundled-sqlite3', - description = 'Build bundled SQLite library', -} - -newoption { - trigger = 'with-bundled-portmidi', - description = 'Build bundled PortMidi library', -} - -newoption { - trigger = 'with-bundled-portaudio', - description = 'Build bundled PortAudio library', -} - newoption { trigger = 'with-bundled-sdl2', description = 'Build bundled SDL2 library', } -newoption { - trigger = 'with-bundled-libuv', - description = 'Build bundled libuv library', -} - newoption { trigger = "distro", description = "Choose distribution", @@ -411,6 +366,8 @@ newoption { } } +dofile ("extlib.lua") + if _OPTIONS["SHLIB"]=="1" then LIBTYPE = "SharedLib" else @@ -665,30 +622,17 @@ else end end --- need to ensure FLAC functions are statically linked -if _OPTIONS["with-bundled-flac"] then +if _OPTIONS["with-system-jpeg"]~=nil then + defines { + "XMD_H", + } +end + +if _OPTIONS["with-system-flac"]~=nil then defines { "FLAC__NO_DLL", } - end - -if not _OPTIONS["with-bundled-jpeg"] then - defines { - "USE_SYSTEM_JPEGLIB", - } - end - -if not _OPTIONS["with-bundled-portmidi"] then - defines { - "USE_SYSTEM_PORTMIDI", - } - end - -if not _OPTIONS["with-bundled-sqlite3"] then - defines { - "USE_SYSTEM_SQLITE", - } - end +end if _OPTIONS["NOASM"]=="1" then defines { @@ -710,11 +654,6 @@ if not _OPTIONS["FORCE_DRC_C_BACKEND"] then end end --- define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used ---ifneq ($(BUILD_JPEGLIB),1) ---DEFS += -DUSE_SYSTEM_JPEGLIB ---endif - defines { "LUA_COMPAT_ALL", "LUA_COMPAT_5_1", diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 688615cbbc3..5819eb54b2a 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -13,7 +13,7 @@ -- expat library objects -------------------------------------------------- -if _OPTIONS["with-bundled-expat"] then +if not _OPTIONS["with-system-expat"] then project "expat" uuid "f4cd40b1-c37c-452d-9785-640f26f0bf54" kind "StaticLib" @@ -45,7 +45,7 @@ end } else links { - "expat", + ext_lib("expat"), } end @@ -53,7 +53,7 @@ end -- zlib library objects -------------------------------------------------- -if _OPTIONS["with-bundled-zlib"] then +if not _OPTIONS["with-system-zlib"] then project "zlib" uuid "3d78bd2a-2bd0-4449-8087-42ddfaef7ec9" kind "StaticLib" @@ -110,7 +110,7 @@ end } else links { - "z", + ext_lib("zlib"), } end @@ -152,7 +152,7 @@ end -- libJPEG library objects -------------------------------------------------- -if _OPTIONS["with-bundled-jpeg"] then +if not _OPTIONS["with-system-jpeg"] then project "jpeg" uuid "447c6800-dcfd-4c48-b72a-a8223bb409ca" kind "StaticLib" @@ -221,7 +221,7 @@ end } else links { - "jpeg", + ext_lib("jpeg"), } end @@ -229,7 +229,7 @@ end -- libflac library objects -------------------------------------------------- -if _OPTIONS["with-bundled-flac"] then +if not _OPTIONS["with-system-flac"] then project "flac" uuid "b6fc19e8-073a-4541-bb7b-d24b548d424a" kind "StaticLib" @@ -312,7 +312,7 @@ end } else links { - "FLAC", + ext_lib("flac"), } end @@ -370,7 +370,7 @@ end -- LUA library objects -------------------------------------------------- -if _OPTIONS["with-bundled-lua"] then +if not _OPTIONS["with-system-lua"] then project "lua" uuid "d9e2eed1-f1ab-4737-a6ac-863700b1a5a9" kind "StaticLib" @@ -460,7 +460,7 @@ end } else links { - "lua", + ext_lib("lua"), } end @@ -493,16 +493,10 @@ project "lualibs" includedirs { MAME_DIR .. "3rdparty", } - if _OPTIONS["with-bundled-lua"] then - includedirs { - MAME_DIR .. "3rdparty/lua/src", - } - end - if _OPTIONS["with-bundled-zlib"] then - includedirs { - MAME_DIR .. "3rdparty/zlib", - } - end + includedirs { + ext_includedir("lua"), + ext_includedir("zlib"), + } files { MAME_DIR .. "3rdparty/lsqlite3/lsqlite3.c", @@ -514,7 +508,7 @@ project "lualibs" -- SQLite3 library objects -------------------------------------------------- -if _OPTIONS["with-bundled-sqlite3"] then +if not _OPTIONS["with-system-sqlite3"] then project "sqllite3" uuid "5cb3d495-57ed-461c-81e5-80dc0857517d" kind "StaticLib" @@ -565,7 +559,7 @@ end } else links { - "sqlite3", + ext_lib("sqlite3"), } end @@ -573,7 +567,7 @@ end -- portmidi library objects -------------------------------------------------- if _OPTIONS["NO_USE_MIDI"]~="1" then -if _OPTIONS["with-bundled-portmidi"] then +if not _OPTIONS["with-system-portmidi"] then project "portmidi" uuid "587f2da6-3274-4a65-86a2-f13ea315bb98" kind "StaticLib" @@ -652,7 +646,7 @@ end end else links { - "portmidi", + ext_lib("portmidi"), } end end @@ -808,7 +802,7 @@ end -- PortAudio library objects -------------------------------------------------- -if _OPTIONS["with-bundled-portaudio"] then +if not _OPTIONS["with-system-portaudio"] then project "portaudio" uuid "0755c5f5-eccf-47f3-98a9-df67018a94d4" kind "StaticLib" @@ -953,7 +947,7 @@ end else links { - "portaudio", + ext_lib("portaudio"), } end @@ -961,7 +955,7 @@ end -- libuv library objects -------------------------------------------------- if _OPTIONS["USE_LIBUV"]=="1" then -if _OPTIONS["with-bundled-libuv"] then +if not _OPTIONS["with-system-uv"] then project "uv" uuid "cd2afe7f-139d-49c3-9000-fc9119f3cea0" kind "StaticLib" @@ -1173,7 +1167,7 @@ project "http-parser" else links { - "libuv", + ext_lib("uv"), } end -------------------------------------------------- @@ -1671,4 +1665,4 @@ end MAME_DIR .. "3rdparty/SDL2/include", } -end \ No newline at end of file +end diff --git a/scripts/src/devices.lua b/scripts/src/devices.lua index c4a6c9fe0ac..3922d3328ac 100644 --- a/scripts/src/devices.lua +++ b/scripts/src/devices.lua @@ -37,17 +37,9 @@ function devicesProject(_target, _subtarget) MAME_DIR .. "3rdparty", GEN_DIR .. "emu", GEN_DIR .. "emu/layout", + ext_includedir("expat"), + ext_includedir("lua"), } - if _OPTIONS["with-bundled-expat"] then - includedirs { - MAME_DIR .. "3rdparty/expat/lib", - } - end - if _OPTIONS["with-bundled-lua"] then - includedirs { - MAME_DIR .. "3rdparty/lua/src", - } - end dofile(path.join("src", "cpu.lua")) @@ -75,17 +67,9 @@ if #disasm_files > 0 then MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", GEN_DIR .. "emu", + ext_includedir("expat"), + ext_includedir("lua"), } - if _OPTIONS["with-bundled-expat"] then - includedirs { - MAME_DIR .. "3rdparty/expat/lib", - } - end - if _OPTIONS["with-bundled-lua"] then - includedirs { - MAME_DIR .. "3rdparty/lua/src", - } - end files { disasm_files diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index a2983d4bd78..56ff55879dd 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -30,16 +30,12 @@ includedirs { GEN_DIR .. "emu", GEN_DIR .. "emu/layout", } -if _OPTIONS["with-bundled-expat"] then - includedirs { - MAME_DIR .. "3rdparty/expat/lib", - } -end -if _OPTIONS["with-bundled-lua"] then - includedirs { - MAME_DIR .. "3rdparty/lua/src", - } -end + +includedirs { + ext_includedir("expat"), + ext_includedir("lua"), + ext_includedir("flac"), +} if (_OPTIONS["targetos"] == "windows" and _OPTIONS["osd"] ~= "osdmini") then defines { diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 6890bceb5bc..c43bbecb291 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -19,17 +19,10 @@ project "utils" MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", + ext_includedir("expat"), + ext_includedir("zlib"), + ext_includedir("flac"), } - if _OPTIONS["with-bundled-expat"] then - includedirs { - MAME_DIR .. "3rdparty/expat/lib", - } - end - if _OPTIONS["with-bundled-zlib"] then - includedirs { - MAME_DIR .. "3rdparty/zlib", - } - end files { MAME_DIR .. "src/lib/util/bitstream.h", @@ -119,14 +112,9 @@ project "formats" MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", MAME_DIR .. "3rdparty", + ext_includedir("zlib"), } - if _OPTIONS["with-bundled-zlib"] then - includedirs { - MAME_DIR .. "3rdparty/zlib", - } - end - files { MAME_DIR .. "src/lib/formats/2d_dsk.cpp", MAME_DIR .. "src/lib/formats/2d_dsk.h", diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 9914509184e..52211bf92fe 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -192,53 +192,29 @@ if #disasm_files > 0 then end links { "utils", - "expat", + ext_lib("expat"), "softfloat", - "jpeg", + ext_lib("jpeg"), "7z", - "lua", + ext_lib("lua"), "lualibs", } if _OPTIONS["USE_LIBUV"]=="1" then links { - "uv", + ext_lib("uv"), "http-parser", } end - if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } - else - links { - "z", - } - end - - if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } - else - links { - "FLAC", - } - end - - if _OPTIONS["with-bundled-sqlite3"] then - links { - "sqllite3", - } - else - links { - "sqlite3", - } - end + links { + ext_lib("zlib"), + ext_lib("flac"), + ext_lib("sqlite3"), + } if _OPTIONS["NO_USE_MIDI"]~="1" then links { - "portmidi", + ext_lib("portmidi"), } end links { @@ -260,14 +236,9 @@ end MAME_DIR .. "3rdparty", GEN_DIR .. _target .. "/layout", GEN_DIR .. "resource", + ext_includedir("zlib"), } - if _OPTIONS["with-bundled-zlib"] then - includedirs { - MAME_DIR .. "3rdparty/zlib", - } - end - if _OPTIONS["targetos"]=="macosx" and (not override_resources) then linkoptions { "-sectcreate __TEXT __info_plist " .. _MAKE.esc(GEN_DIR) .. "resource/" .. _subtarget .. "-Info.plist" diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua index 917a450d511..95d0371e414 100644 --- a/scripts/src/netlist.lua +++ b/scripts/src/netlist.lua @@ -19,13 +19,8 @@ project "netlist" MAME_DIR .. "src/lib/netlist", MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", + -- ext_includedir("expat"), } - -- if _OPTIONS["with-bundled-expat"] then - -- includedirs { - -- MAME_DIR .. "3rdparty/expat/lib", - -- } - --end - files { MAME_DIR .. "src/lib/netlist/nl_config.h", diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index 5ea9bec2f1c..a8b8debe272 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -178,6 +178,10 @@ function osdmodulesbuild() defines { "NO_USE_MIDI", } + else + includedirs { + ext_includedir("portmidi"), + } end if _OPTIONS["USE_QTDEBUG"]=="1" then diff --git a/scripts/src/tests.lua b/scripts/src/tests.lua index e69888d53a4..b6a01efdd02 100644 --- a/scripts/src/tests.lua +++ b/scripts/src/tests.lua @@ -62,8 +62,8 @@ project("mametests") links { "gtest", "utils", - "expat", - "zlib", + ext_lib("expat"), + ext_lib("zlib"), "ocore_" .. _OPTIONS["osd"], } @@ -72,6 +72,8 @@ project("mametests") MAME_DIR .. "src/osd", MAME_DIR .. "src/emu", MAME_DIR .. "src/lib/util", + ext_includedir("expat"), + ext_includedir("zlib"), } files { diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index 0339e9920b2..95710ad9799 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -27,21 +27,12 @@ end links { "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -77,31 +68,13 @@ end links { "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -139,20 +112,11 @@ end links { "utils", - "expat", + ext_lib("expat"), "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -189,31 +153,13 @@ end links { "dasm", "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/emu", @@ -251,31 +197,13 @@ end links { "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -312,31 +240,13 @@ end links { "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -373,20 +283,11 @@ end links { "utils", - "expat", + ext_lib("expat"), "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -422,20 +323,11 @@ end links { "utils", - "expat", + ext_lib("expat"), "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -471,20 +363,11 @@ end links { "utils", - "expat", + ext_lib("expat"), "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -520,31 +403,13 @@ end links { "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -580,20 +445,11 @@ end links { "utils", - "expat", + ext_lib("expat"), "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -629,32 +485,14 @@ end links { "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], "netlist", + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib/util", @@ -732,31 +570,13 @@ end links { "formats", "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib", @@ -795,31 +615,13 @@ links { "formats", "emu", "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib", @@ -858,36 +660,18 @@ links { "formats", "emu", "utils", - "expat", + ext_lib("expat"), "7z", "ocore_" .. _OPTIONS["osd"], + ext_lib("zlib"), + ext_lib("flac"), } -if _OPTIONS["with-bundled-zlib"] then - links { - "zlib", - } -else - links { - "z", - } -end - -if _OPTIONS["with-bundled-flac"] then - links { - "flac", - } -else - links { - "FLAC", - } -end - includedirs { MAME_DIR .. "src/osd", MAME_DIR .. "src/lib", MAME_DIR .. "src/lib/util", - MAME_DIR .. "3rdparty/zlib", + ext_includedir("zlib"), MAME_DIR .. "src/tools/imgtool", } diff --git a/src/emu/luaengine.cpp b/src/emu/luaengine.cpp index fbd2e64fc76..cd392de3c89 100644 --- a/src/emu/luaengine.cpp +++ b/src/emu/luaengine.cpp @@ -10,7 +10,7 @@ #include #include -#include "lua.hpp" +#include #include "luabridge/Source/LuaBridge/LuaBridge.h" #include #include "emu.h" diff --git a/src/lib/util/flac.h b/src/lib/util/flac.h index 1f9a49b14bd..2bb41964a43 100644 --- a/src/lib/util/flac.h +++ b/src/lib/util/flac.h @@ -16,11 +16,7 @@ #include "osdcore.h" #include "corefile.h" -#ifdef FLAC__NO_DLL -#include "libflac/include/FLAC/all.h" -#else #include -#endif //************************************************************************** diff --git a/src/osd/modules/midi/portmidi.cpp b/src/osd/modules/midi/portmidi.cpp index a158b9033cd..4abbf78df56 100644 --- a/src/osd/modules/midi/portmidi.cpp +++ b/src/osd/modules/midi/portmidi.cpp @@ -10,11 +10,7 @@ #ifndef NO_USE_MIDI -#ifndef USE_SYSTEM_PORTMIDI -#include "portmidi/pm_common/portmidi.h" -#else #include -#endif #include "osdcore.h" #include "corealloc.h" #include "modules/osdmodule.h"