1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Fixes for compiling with a newer (system) jsoncpp (#4429)

* Move included json code to jsoncpp subdirectory

This is needed to avoid having to specify the minetest src directory
as a system include when fixing the json includes.

* Fix json includes

They used "", so that the compiler searches the project's directory
first. The result was that when compiling with a system jsoncpp,
the project's own version of json.h was still included, instead of
the system version.

The includes now use <>, so a system location, or one specified with
'-Ilocation' is searched only.

* Fix for jsoncpp deprecated function warning

When compiling with a newer version of jsoncpp (and
ENABLE_SYSTEM_JSONCPP=true), jsoncpp emits a warning
about a deprecated function that minetest uses.
This commit is contained in:
Rogier-5 2016-08-10 12:10:00 +02:00 committed by est31
parent 058a869b70
commit 4503b5097f
11 changed files with 13 additions and 8 deletions

View file

@ -0,0 +1,7 @@
if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
endif()
add_library(jsoncpp jsoncpp.cpp)
target_link_libraries(jsoncpp)

16
src/jsoncpp/json/UPDATING Normal file
View file

@ -0,0 +1,16 @@
#!/bin/sh
cd ..
svn co https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp jsoncpp
svn up jsoncpp
cd jsoncpp
python amalgamate.py
cp -R dist/json ..
cp dist/jsoncpp.cpp ../json
# maybe you need to patch:
# src/json/jsoncpp.cpp:
# -#include <json/json.h>
# +#include "json/json.h"
#svn export --force https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json json
#svn export --force https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/include/json json

1914
src/jsoncpp/json/json.h Normal file

File diff suppressed because it is too large Load diff

4367
src/jsoncpp/json/jsoncpp.cpp Normal file

File diff suppressed because it is too large Load diff