mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-10-22 07:21:21 +00:00
build system: look for & use system-wide version of nlohmann json-cpp
If one is found, it will be used. Otherwise the included version in lib/nlohmann-json will be used. Implements #1858.
This commit is contained in:
parent
5fe1b0be03
commit
e52f878720
3
NEWS.md
3
NEWS.md
@ -48,6 +48,9 @@
|
||||
|
||||
## Build system changes
|
||||
|
||||
* nlohman json-cpp: configure now looks for a system-wide installed version of
|
||||
the nlohmann json-cpp header-only library. If one is found, it is used;
|
||||
otherwise the included version will be used. Implements #1858.
|
||||
* If MKVToolNix is built with rake v10.0.0 or newer, its "multitask" feature
|
||||
will be turned on allowing automatic parallel builds.
|
||||
* CURL is no longer used by MKVToolNix and is therefore not required
|
||||
|
32
ac/nlohmann_jsoncpp.m4
Normal file
32
ac/nlohmann_jsoncpp.m4
Normal file
@ -0,0 +1,32 @@
|
||||
dnl
|
||||
dnl Check for nlohmann's json-cpp library
|
||||
dnl
|
||||
|
||||
|
||||
AC_CACHE_CHECK([nlohmann's json-cpp],[ac_cv_nlohmann_jsoncpp],[
|
||||
AC_LANG_PUSH(C++)
|
||||
|
||||
AC_TRY_COMPILE([
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
#include <json.hpp>
|
||||
],[
|
||||
nlohmann::json json{
|
||||
{ "unsigned_64bit_integer", std::numeric_limits<std::uint64_t>::max() },
|
||||
{ "signed_64bit_integer", std::numeric_limits<std::int64_t>::min() },
|
||||
};
|
||||
|
||||
std::cout << json.dump();
|
||||
],[ac_cv_nlohmann_jsoncpp=yes],[ac_cv_nlohmann_jsoncpp=no])
|
||||
|
||||
AC_LANG_POP
|
||||
])
|
||||
|
||||
if test x"$ac_cv_nlohmann_jsoncpp" = xyes; then
|
||||
AC_MSG_NOTICE([Using the system version of nlohmann json-cpp])
|
||||
AC_DEFINE([HAVE_NLOHMANN_JSONCPP],[1],[Define if nlohmann's json-cpp is available.])
|
||||
else
|
||||
AC_MSG_NOTICE([Using the internal version of nlohmann json-cpp])
|
||||
fi
|
@ -29,6 +29,7 @@ m4_include(ac/vorbis.m4)
|
||||
m4_include(ac/flac.m4)
|
||||
m4_include(ac/matroska.m4)
|
||||
m4_include(ac/pugixml.m4)
|
||||
m4_include(ac/nlohmann_jsoncpp.m4)
|
||||
m4_include(ac/utf8cpp.m4)
|
||||
m4_include(ac/zlib.m4)
|
||||
m4_include(ac/qt5.m4)
|
||||
|
@ -12,6 +12,7 @@ Build-Depends:
|
||||
libboost-dev (>= 1.46), libboost-filesystem-dev (>= 1.46),
|
||||
libboost-regex-dev (>= 1.46), libboost-date-time-dev (>= 1.46),
|
||||
libboost-system-dev (>= 1.46), qtbase5-dev, qtbase5-dev-tools,
|
||||
base-files (< 9.6) | nlohmann-json-dev (>= 2),
|
||||
pkg-config
|
||||
|
||||
Package: mkvtoolnix
|
||||
|
@ -26,7 +26,7 @@ BuildRequires: gcc5-c++
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: gcc-c++ >= 4.9.0, rubypick, pugixml-devel, rubygem-rake
|
||||
BuildRequires: gcc-c++ >= 4.9.0, rubypick, pugixml-devel, rubygem-rake, json-devel >= 2
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "common/json.h"
|
||||
#include "common/strings/editing.h"
|
||||
#include "nlohmann-json/src/json.hpp"
|
||||
|
||||
namespace mtx { namespace id {
|
||||
|
||||
|
@ -16,7 +16,11 @@
|
||||
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "nlohmann-json/src/json.hpp"
|
||||
#if defined(HAVE_NLOHMANN_JSONCPP)
|
||||
# include <json.hpp>
|
||||
#else
|
||||
# include "nlohmann-json/src/json.hpp"
|
||||
#endif // HAVE_NLOHMANN_JSONCPP
|
||||
|
||||
namespace mtx { namespace json {
|
||||
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
#include <ebml/EbmlElement.h>
|
||||
|
||||
#include "common/json.h"
|
||||
#include "common/locale.h"
|
||||
#include "common/mm_io.h"
|
||||
#include "nlohmann-json/src/json.hpp"
|
||||
|
||||
using namespace libebml;
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "merge/generic_reader.h"
|
||||
#include "merge/input_x.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "nlohmann-json/src/json.hpp"
|
||||
|
||||
static int64_rational_c s_probe_range_percentage{3, 10}; // 0.3%
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "nlohmann-json/src/json.hpp"
|
||||
#include "common/json.h"
|
||||
|
||||
class QVariant;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user