mirror of
https://github.com/holub/mame
synced 2025-06-03 19:36:26 +03:00
Enable use of system-wide asio, glm and rapidjson (#3172)
* Fixed building using system utf8proc * Fixed building using system portaudio * Allow using system-wide asio headers (1.11.0 or higher required). * Allow using system-wide glm headers * Allow using system-wide rapidjson headers
This commit is contained in:
parent
556bdf249f
commit
8cc758355d
15
makefile
15
makefile
@ -55,6 +55,7 @@
|
||||
# OPT_FLAGS =
|
||||
# LDOPTS =
|
||||
|
||||
# USE_SYSTEM_LIB_ASIO = 1
|
||||
# USE_SYSTEM_LIB_EXPAT = 1
|
||||
# USE_SYSTEM_LIB_ZLIB = 1
|
||||
# USE_SYSTEM_LIB_JPEG = 1
|
||||
@ -65,6 +66,8 @@
|
||||
# USE_SYSTEM_LIB_PORTAUDIO = 1
|
||||
# USE_BUNDLED_LIB_SDL2 = 1
|
||||
# USE_SYSTEM_LIB_UTF8PROC = 1
|
||||
# USE_SYSTEM_LIB_GLM = 1
|
||||
# USE_SYSTEM_LIB_RAPIDJSON = 1
|
||||
|
||||
# MESA_INSTALL_ROOT = /opt/mesa
|
||||
# SDL_INSTALL_ROOT = /opt/sdl2
|
||||
@ -429,6 +432,10 @@ endif
|
||||
# which 3rdparty library to build;
|
||||
# link against system (common) library otherwise
|
||||
#-------------------------------------------------
|
||||
ifdef USE_SYSTEM_LIB_ASIO
|
||||
PARAMS += --with-system-asio='$(USE_SYSTEM_LIB_ASIO)'
|
||||
endif
|
||||
|
||||
ifdef USE_SYSTEM_LIB_EXPAT
|
||||
PARAMS += --with-system-expat='$(USE_SYSTEM_LIB_EXPAT)'
|
||||
endif
|
||||
@ -465,6 +472,14 @@ ifdef USE_SYSTEM_LIB_UTF8PROC
|
||||
PARAMS += --with-system-utf8proc='$(USE_SYSTEM_LIB_UTF8PROC)'
|
||||
endif
|
||||
|
||||
ifdef USE_SYSTEM_LIB_GLM
|
||||
PARAMS += --with-system-glm='$(USE_SYSTEM_LIB_GLM)'
|
||||
endif
|
||||
|
||||
ifdef USE_SYSTEM_LIB_RAPIDJSON
|
||||
PARAMS += --with-system-rapidjson='$(USE_SYSTEM_LIB_RAPIDJSON)'
|
||||
endif
|
||||
|
||||
# reverse logic for this one
|
||||
|
||||
ifdef USE_BUNDLED_LIB_SDL2
|
||||
|
@ -6,6 +6,7 @@ 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" },
|
||||
jpeg = { "jpeg", "3rdparty/libjpeg" },
|
||||
@ -15,9 +16,16 @@ local extlibs = {
|
||||
portaudio = { "portaudio", "3rdparty/portaudio/include" },
|
||||
lua = { "lua", "3rdparty/lua/src" },
|
||||
utf8proc = { "utf8proc", "3rdparty/utf8proc" },
|
||||
glm = { "glm", "3rdparty/glm" },
|
||||
rapidjson = { "rapidjson", "3rdparty/rapidjson/include" },
|
||||
}
|
||||
|
||||
-- system lib options
|
||||
newoption {
|
||||
trigger = 'with-system-asio',
|
||||
description = 'Use system Asio library',
|
||||
}
|
||||
|
||||
newoption {
|
||||
trigger = 'with-system-expat',
|
||||
description = 'Use system Expat library',
|
||||
@ -63,6 +71,16 @@ newoption {
|
||||
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",
|
||||
}
|
||||
|
||||
-- build helpers
|
||||
function ext_lib(lib)
|
||||
local opt = _OPTIONS["with-system-" .. lib]
|
||||
|
@ -39,9 +39,9 @@ function devicesProject(_target, _subtarget)
|
||||
MAME_DIR .. "3rdparty",
|
||||
GEN_DIR .. "emu",
|
||||
GEN_DIR .. "emu/layout",
|
||||
ext_includedir("asio"),
|
||||
ext_includedir("expat"),
|
||||
ext_includedir("flac"),
|
||||
MAME_DIR .. "3rdparty/asio/include",
|
||||
}
|
||||
|
||||
dofile(path.join("src", "cpu.lua"))
|
||||
@ -69,8 +69,8 @@ if #disasm_files > 0 then
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/util",
|
||||
MAME_DIR .. "3rdparty",
|
||||
MAME_DIR .. "3rdparty/asio/include",
|
||||
GEN_DIR .. "emu",
|
||||
ext_includedir("asio"),
|
||||
ext_includedir("expat"),
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,12 @@ includedirs {
|
||||
}
|
||||
|
||||
includedirs {
|
||||
ext_includedir("asio"),
|
||||
ext_includedir("expat"),
|
||||
ext_includedir("zlib"),
|
||||
ext_includedir("flac"),
|
||||
ext_includedir("jpeg"),
|
||||
MAME_DIR .. "3rdparty/asio/include",
|
||||
ext_includedir("rapidjson"),
|
||||
}
|
||||
|
||||
files {
|
||||
|
@ -29,18 +29,18 @@ includedirs {
|
||||
MAME_DIR .. "src/devices", -- till deps are fixed
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/util",
|
||||
MAME_DIR .. "3rdparty/rapidjson/include",
|
||||
MAME_DIR .. "3rdparty",
|
||||
GEN_DIR .. "emu",
|
||||
GEN_DIR .. "emu/layout",
|
||||
}
|
||||
|
||||
includedirs {
|
||||
ext_includedir("asio"),
|
||||
ext_includedir("expat"),
|
||||
ext_includedir("lua"),
|
||||
ext_includedir("zlib"),
|
||||
ext_includedir("flac"),
|
||||
MAME_DIR .. "3rdparty/asio/include",
|
||||
ext_includedir("rapidjson")
|
||||
}
|
||||
|
||||
configuration { }
|
||||
|
@ -116,7 +116,7 @@ function osdmodulesbuild()
|
||||
MAME_DIR .. "src/osd/modules/monitor/monitor_sdl.cpp",
|
||||
}
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/asio/include",
|
||||
ext_includedir("asio"),
|
||||
}
|
||||
|
||||
if _OPTIONS["targetos"]=="windows" then
|
||||
@ -215,7 +215,7 @@ function osdmodulesbuild()
|
||||
MAME_DIR .. "3rdparty/bgfx/include",
|
||||
MAME_DIR .. "3rdparty/bgfx/3rdparty",
|
||||
MAME_DIR .. "3rdparty/bx/include",
|
||||
MAME_DIR .. "3rdparty/rapidjson/include",
|
||||
ext_includedir("rapidjson")
|
||||
}
|
||||
|
||||
if _OPTIONS["NO_USE_PORTAUDIO"]=="1" then
|
||||
|
@ -3156,6 +3156,11 @@ files {
|
||||
}
|
||||
|
||||
createMAMEProjects(_target, _subtarget, "sega")
|
||||
|
||||
includedirs {
|
||||
ext_includedir("glm"),
|
||||
}
|
||||
|
||||
files {
|
||||
MAME_DIR .. "src/mame/drivers/angelkds.cpp",
|
||||
MAME_DIR .. "src/mame/includes/angelkds.h",
|
||||
|
@ -2706,7 +2706,7 @@ files {
|
||||
MAME_DIR .. "src/mame/machine/nl_prodigy.h",
|
||||
}
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty/rapidjson/include",
|
||||
ext_includedir("rapidjson"),
|
||||
}
|
||||
|
||||
createMESSProjects(_target, _subtarget, "psion")
|
||||
|
@ -114,6 +114,7 @@ function createProjects_mame_nl(_target, _subtarget)
|
||||
MAME_DIR .. "src/lib/util",
|
||||
MAME_DIR .. "3rdparty",
|
||||
GEN_DIR .. "mame/layout",
|
||||
ext_includedir("rapidjson"),
|
||||
}
|
||||
|
||||
files{
|
||||
|
@ -84,8 +84,8 @@
|
||||
#include "network.h"
|
||||
#include "ui/uimain.h"
|
||||
#include <time.h>
|
||||
#include "rapidjson/include/rapidjson/writer.h"
|
||||
#include "rapidjson/include/rapidjson/stringbuffer.h"
|
||||
#include <rapidjson/writer.h>
|
||||
#include <rapidjson/stringbuffer.h>
|
||||
|
||||
#if defined(EMSCRIPTEN)
|
||||
#include <emscripten.h>
|
||||
|
@ -4,7 +4,7 @@
|
||||
#define CLIENT_HTTPS_HPP
|
||||
|
||||
#include "client_http.hpp"
|
||||
#include "asio/ssl.hpp"
|
||||
#include <asio/ssl.hpp>
|
||||
|
||||
namespace webpp {
|
||||
using HTTPS = asio::ssl::stream<asio::ip::tcp::socket>;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#define CLIENT_WSS_HPP
|
||||
|
||||
#include "client_ws.hpp"
|
||||
#include "asio/ssl.hpp"
|
||||
#include <asio/ssl.hpp>
|
||||
|
||||
namespace webpp {
|
||||
using WSS = asio::ssl::stream<asio::ip::tcp::socket>;
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "server_http.hpp"
|
||||
#include "asio.h"
|
||||
#include "asio/system_timer.hpp"
|
||||
#include <asio/system_timer.hpp>
|
||||
#include "path_to_regex.hpp"
|
||||
|
||||
#include <map>
|
||||
|
@ -4,7 +4,7 @@
|
||||
#define SERVER_HTTPS_HPP
|
||||
|
||||
#include "server_http.hpp"
|
||||
#include "asio/ssl.hpp"
|
||||
#include <asio/ssl.hpp>
|
||||
#include <openssl/ssl.h>
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "crypto.hpp"
|
||||
|
||||
#include "asio.h"
|
||||
#include "asio/system_timer.hpp"
|
||||
#include <asio/system_timer.hpp>
|
||||
|
||||
#include "server_ws.hpp"
|
||||
#include <unordered_map>
|
||||
|
@ -4,7 +4,7 @@
|
||||
#define SERVER_WSS_HPP
|
||||
|
||||
#include "server_ws.hpp"
|
||||
#include "asio/ssl.hpp"
|
||||
#include <asio/ssl.hpp>
|
||||
#include <openssl/ssl.h>
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -81,9 +81,9 @@
|
||||
#include <zlib.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "rapidjson/include/rapidjson/document.h"
|
||||
#include "rapidjson/include/rapidjson/stringbuffer.h"
|
||||
#include "rapidjson/include/rapidjson/writer.h"
|
||||
#include <rapidjson/document.h>
|
||||
#include <rapidjson/stringbuffer.h>
|
||||
#include <rapidjson/writer.h>
|
||||
#endif
|
||||
|
||||
// Generated artwork includes
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "screen.h"
|
||||
|
||||
#include <glm/glm/vec3.hpp>
|
||||
#include <glm/vec3.hpp>
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Olivier Galibert
|
||||
|
||||
#include <glm/glm/geometric.hpp>
|
||||
#include <glm/geometric.hpp>
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/mb86233/mb86233.h"
|
||||
|
@ -31,5 +31,5 @@
|
||||
#define ASIO_NOEXCEPT_OR_NOTHROW noexcept(true)
|
||||
#define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
|
||||
|
||||
#include "asio/include/asio.hpp"
|
||||
#include <asio.hpp>
|
||||
#undef interface
|
||||
|
Loading…
Reference in New Issue
Block a user