summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Julian Sikorski <belegdol+github@gmail.com>2018-03-18 15:30:55 +0100
committer Vas Crabb <cuavas@users.noreply.github.com>2018-03-27 10:19:22 +1100
commit9a154947d1cb61180eb00bffa919e7921c2d5234 (patch)
treee434fe833f804465a46f5824873666f791eea841
parent4419ff325aa248de92512a25cd9ef36e5bf22183 (diff)
Added possibility of building using system pugixml
-rw-r--r--makefile5
-rw-r--r--scripts/extlib.lua6
-rw-r--r--scripts/genie.lua10
-rw-r--r--scripts/src/emu.lua1
-rw-r--r--src/emu/hashfile.cpp3
5 files changed, 23 insertions, 2 deletions
diff --git a/makefile b/makefile
index 8e46e9133f2..dd3024c07db 100644
--- a/makefile
+++ b/makefile
@@ -68,6 +68,7 @@
# USE_SYSTEM_LIB_UTF8PROC = 1
# USE_SYSTEM_LIB_GLM = 1
# USE_SYSTEM_LIB_RAPIDJSON = 1
+# USE_SYSTEM_LIB_PUGIXML = 1
# MESA_INSTALL_ROOT = /opt/mesa
# SDL_INSTALL_ROOT = /opt/sdl2
@@ -480,6 +481,10 @@ ifdef USE_SYSTEM_LIB_RAPIDJSON
PARAMS += --with-system-rapidjson='$(USE_SYSTEM_LIB_RAPIDJSON)'
endif
+ifdef USE_SYSTEM_LIB_PUGIXML
+PARAMS += --with-system-pugixml='$(USE_SYSTEM_LIB_PUGIXML)'
+endif
+
# reverse logic for this one
ifdef USE_BUNDLED_LIB_SDL2
diff --git a/scripts/extlib.lua b/scripts/extlib.lua
index e3f7168fe38..a1fa4f5eb9d 100644
--- a/scripts/extlib.lua
+++ b/scripts/extlib.lua
@@ -18,6 +18,7 @@ local extlibs = {
utf8proc = { "utf8proc", "3rdparty/utf8proc" },
glm = { "glm", "3rdparty/glm" },
rapidjson = { "rapidjson", "3rdparty/rapidjson/include" },
+ pugixml = { "pugixml", "3rdparty/pugixml/src" },
}
-- system lib options
@@ -81,6 +82,11 @@ newoption {
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]
diff --git a/scripts/genie.lua b/scripts/genie.lua
index ad7018ed5c8..9338567cb54 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -671,6 +671,16 @@ if not _OPTIONS["with-system-flac"]~=nil then
}
end
+if not _OPTIONS["with-system-pugixml"] then
+ defines {
+ "PUGIXML_HEADER_ONLY",
+ }
+else
+ links {
+ ext_lib("pugixml"),
+ }
+end
+
if _OPTIONS["NOASM"]=="1" then
defines {
"MAME_NOASM"
diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua
index 88af75653c8..cc281b6a8c3 100644
--- a/scripts/src/emu.lua
+++ b/scripts/src/emu.lua
@@ -35,6 +35,7 @@ includedirs {
ext_includedir("flac"),
ext_includedir("jpeg"),
ext_includedir("rapidjson"),
+ ext_includedir("pugixml"),
}
files {
diff --git a/src/emu/hashfile.cpp b/src/emu/hashfile.cpp
index 0d540f6f1ec..6ded9a0e397 100644
--- a/src/emu/hashfile.cpp
+++ b/src/emu/hashfile.cpp
@@ -14,8 +14,7 @@
#include "emuopts.h"
#include "hash.h"
#include "drivenum.h"
-#define PUGIXML_HEADER_ONLY
-#include "pugixml/src/pugixml.hpp"
+#include <pugixml.hpp>
/*-------------------------------------------------
hashfile_lookup