Added possibility of building using system pugixml

This commit is contained in:
Julian Sikorski 2018-03-18 15:30:55 +01:00 committed by Vas Crabb
parent 4419ff325a
commit 9a154947d1
5 changed files with 23 additions and 2 deletions

View File

@ -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

View File

@ -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]

View File

@ -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"

View File

@ -35,6 +35,7 @@ includedirs {
ext_includedir("flac"),
ext_includedir("jpeg"),
ext_includedir("rapidjson"),
ext_includedir("pugixml"),
}
files {

View File

@ -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