Update embedded jsoncpp from unk version to 0.10.6 + move libs to lib/ instead of src/ (#5473)

* Update embedded jsoncpp from unk version to 0.10.6

0.10.6 is last release without c++11

* Make jsoncpp more compliant with its amalgamate

Jsoncpp cpp file should be upper, make the library like it does in amalgamate

* Reorganization: move minetest embedded libs outside of source tree to /lib

* Fix a dead grep in LINT
master
Loïc Blot 2017-04-02 10:51:50 +02:00 committed by GitHub
parent 75fb3e4730
commit 86b1542181
75 changed files with 6986 additions and 6345 deletions

View File

@ -191,6 +191,7 @@ endif()
# Subdirectories # Subdirectories
# Be sure to add all relevant definitions above this # Be sure to add all relevant definitions above this
add_subdirectory(lib)
add_subdirectory(src) add_subdirectory(src)

View File

@ -98,8 +98,8 @@ endif
LOCAL_C_INCLUDES := \ LOCAL_C_INCLUDES := \
jni/src \ jni/src \
jni/src/script \ jni/src/script \
jni/src/lua/src \ jni/lib/lua/src \
jni/src/jsoncpp \ jni/lib/jsoncpp \
jni/src/cguittfont \ jni/src/cguittfont \
deps/irrlicht/include \ deps/irrlicht/include \
deps/libiconv/include \ deps/libiconv/include \
@ -335,36 +335,36 @@ LOCAL_SRC_FILES += jni/src/cguittfont/xCGUITTFont.cpp
# Lua # Lua
LOCAL_SRC_FILES += \ LOCAL_SRC_FILES += \
jni/src/lua/src/lapi.c \ jni/lib/lua/src/lapi.c \
jni/src/lua/src/lauxlib.c \ jni/lib/lua/src/lauxlib.c \
jni/src/lua/src/lbaselib.c \ jni/lib/lua/src/lbaselib.c \
jni/src/lua/src/lcode.c \ jni/lib/lua/src/lcode.c \
jni/src/lua/src/ldblib.c \ jni/lib/lua/src/ldblib.c \
jni/src/lua/src/ldebug.c \ jni/lib/lua/src/ldebug.c \
jni/src/lua/src/ldo.c \ jni/lib/lua/src/ldo.c \
jni/src/lua/src/ldump.c \ jni/lib/lua/src/ldump.c \
jni/src/lua/src/lfunc.c \ jni/lib/lua/src/lfunc.c \
jni/src/lua/src/lgc.c \ jni/lib/lua/src/lgc.c \
jni/src/lua/src/linit.c \ jni/lib/lua/src/linit.c \
jni/src/lua/src/liolib.c \ jni/lib/lua/src/liolib.c \
jni/src/lua/src/llex.c \ jni/lib/lua/src/llex.c \
jni/src/lua/src/lmathlib.c \ jni/lib/lua/src/lmathlib.c \
jni/src/lua/src/lmem.c \ jni/lib/lua/src/lmem.c \
jni/src/lua/src/loadlib.c \ jni/lib/lua/src/loadlib.c \
jni/src/lua/src/lobject.c \ jni/lib/lua/src/lobject.c \
jni/src/lua/src/lopcodes.c \ jni/lib/lua/src/lopcodes.c \
jni/src/lua/src/loslib.c \ jni/lib/lua/src/loslib.c \
jni/src/lua/src/lparser.c \ jni/lib/lua/src/lparser.c \
jni/src/lua/src/lstate.c \ jni/lib/lua/src/lstate.c \
jni/src/lua/src/lstring.c \ jni/lib/lua/src/lstring.c \
jni/src/lua/src/lstrlib.c \ jni/lib/lua/src/lstrlib.c \
jni/src/lua/src/ltable.c \ jni/lib/lua/src/ltable.c \
jni/src/lua/src/ltablib.c \ jni/lib/lua/src/ltablib.c \
jni/src/lua/src/ltm.c \ jni/lib/lua/src/ltm.c \
jni/src/lua/src/lundump.c \ jni/lib/lua/src/lundump.c \
jni/src/lua/src/lvm.c \ jni/lib/lua/src/lvm.c \
jni/src/lua/src/lzio.c \ jni/lib/lua/src/lzio.c \
jni/src/lua/src/print.c jni/lib/lua/src/print.c
# SQLite3 # SQLite3
LOCAL_SRC_FILES += deps/sqlite/sqlite3.c LOCAL_SRC_FILES += deps/sqlite/sqlite3.c
@ -377,7 +377,7 @@ LOCAL_SRC_FILES += \
jni/src/threading/thread.cpp jni/src/threading/thread.cpp
# JSONCPP # JSONCPP
LOCAL_SRC_FILES += jni/src/jsoncpp/json/jsoncpp.cpp LOCAL_SRC_FILES += jni/lib/jsoncpp/jsoncpp.cpp
LOCAL_SHARED_LIBRARIES := iconv openal ogg vorbis gmp LOCAL_SHARED_LIBRARIES := iconv openal ogg vorbis gmp
LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto android_native_app_glue $(PROFILER_LIBS) LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto android_native_app_glue $(PROFILER_LIBS)

View File

@ -1,7 +1,6 @@
option(ENABLE_SYSTEM_GMP "Use GMP from system" TRUE) option(ENABLE_SYSTEM_GMP "Use GMP from system" TRUE)
mark_as_advanced(GMP_LIBRARY GMP_INCLUDE_DIR) mark_as_advanced(GMP_LIBRARY GMP_INCLUDE_DIR)
set(USE_SYSTEM_GMP FALSE) set(USE_SYSTEM_GMP FALSE PARENT_SCOPE)
if(ENABLE_SYSTEM_GMP) if(ENABLE_SYSTEM_GMP)
find_library(GMP_LIBRARY NAMES libgmp.so) find_library(GMP_LIBRARY NAMES libgmp.so)
@ -10,6 +9,7 @@ if(ENABLE_SYSTEM_GMP)
if(GMP_LIBRARY AND GMP_INCLUDE_DIR) if(GMP_LIBRARY AND GMP_INCLUDE_DIR)
message (STATUS "Using GMP provided by system.") message (STATUS "Using GMP provided by system.")
set(USE_SYSTEM_GMP TRUE) set(USE_SYSTEM_GMP TRUE)
set(USE_SYSTEM_GMP TRUE PARENT_SCOPE)
else() else()
message (STATUS "Detecting GMP from system failed.") message (STATUS "Detecting GMP from system failed.")
endif() endif()
@ -19,8 +19,10 @@ endif()
if(NOT USE_SYSTEM_GMP) if(NOT USE_SYSTEM_GMP)
message(STATUS "Using bundled mini-gmp library.") message(STATUS "Using bundled mini-gmp library.")
set(GMP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/gmp) set(GMP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gmp)
set(GMP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gmp PARENT_SCOPE)
set(GMP_LIBRARY gmp) set(GMP_LIBRARY gmp)
set(GMP_LIBRARY gmp PARENT_SCOPE)
add_subdirectory(gmp) add_subdirectory(gmp)
endif() endif()

View File

@ -20,8 +20,7 @@ endif()
if(NOT JSONCPP_FOUND) if(NOT JSONCPP_FOUND)
message(STATUS "Using bundled JSONCPP library.") message(STATUS "Using bundled JSONCPP library.")
set(JSON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/jsoncpp) set(JSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp PARENT_SCOPE)
set(JSON_LIBRARY jsoncpp) set(JSON_LIBRARY jsoncpp PARENT_SCOPE)
add_subdirectory(jsoncpp/json) add_subdirectory(jsoncpp)
endif() endif()

23
lib/CMakeLists.txt Normal file
View File

@ -0,0 +1,23 @@
# LuaJIT
option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
set(USE_LUAJIT FALSE PARENT_SCOPE)
if(ENABLE_LUAJIT)
find_package(LuaJIT)
if(LUAJIT_FOUND)
set(USE_LUAJIT TRUE)
set(USE_LUAJIT TRUE PARENT_SCOPE)
message (STATUS "Using LuaJIT provided by system.")
endif(LUAJIT_FOUND)
else()
message (STATUS "LuaJIT detection disabled! (ENABLE_LUAJIT=0)")
endif()
if(NOT USE_LUAJIT)
message(STATUS "LuaJIT not found, using bundled Lua.")
set(LUA_LIBRARY lua PARENT_SCOPE)
set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lua/src PARENT_SCOPE)
add_subdirectory(lua)
endif()
find_package(GMP REQUIRED)
find_package(Json REQUIRED)

1981
lib/jsoncpp/json/json.h Normal file

File diff suppressed because it is too large Load Diff

4937
lib/jsoncpp/jsoncpp.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -156,26 +156,6 @@ if(ENABLE_FREETYPE)
endif() endif()
endif(ENABLE_FREETYPE) endif(ENABLE_FREETYPE)
# LuaJIT
option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
set(USE_LUAJIT FALSE)
if(ENABLE_LUAJIT)
find_package(LuaJIT)
if(LUAJIT_FOUND)
set(USE_LUAJIT TRUE)
endif(LUAJIT_FOUND)
else()
message (STATUS "LuaJIT detection disabled! (ENABLE_LUAJIT=0)")
endif()
if(NOT USE_LUAJIT)
message(STATUS "LuaJIT not found, using bundled Lua.")
set(LUA_LIBRARY "lua")
set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
add_subdirectory(lua)
endif()
find_package(GMP REQUIRED)
option(ENABLE_CURSES "Enable ncurses console" TRUE) option(ENABLE_CURSES "Enable ncurses console" TRUE)
set(USE_CURSES FALSE) set(USE_CURSES FALSE)
@ -253,7 +233,6 @@ endif(ENABLE_REDIS)
find_package(SQLite3 REQUIRED) find_package(SQLite3 REQUIRED)
find_package(Json REQUIRED)
OPTION(ENABLE_SPATIAL "Enable SpatialIndex AreaStore backend" TRUE) OPTION(ENABLE_SPATIAL "Enable SpatialIndex AreaStore backend" TRUE)
set(USE_SPATIAL FALSE) set(USE_SPATIAL FALSE)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@
#if USE_SYSTEM_GMP || defined (__ANDROID__) || defined (ANDROID) #if USE_SYSTEM_GMP || defined (__ANDROID__) || defined (ANDROID)
#include <gmp.h> #include <gmp.h>
#else #else
#include <gmp/mini-gmp.h> #include <mini-gmp.h>
#endif #endif
#include <util/sha2.h> #include <util/sha2.h>

View File

@ -10,10 +10,10 @@ function perform_lint() {
if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then
# Get list of every file modified in this pull request # Get list of every file modified in this pull request
files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | egrep -v '^src/(gmp|lua|jsoncpp)/' || true)" files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' | true)"
else else
# Check everything for branch pushes # Check everything for branch pushes
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h' | egrep -v '^src/(gmp|lua|jsoncpp)/')" files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
fi fi
local errorcount=0 local errorcount=0