Upgrade jsoncpp to 1.9.5 (#2144)

* test jsoncpp upgrade

* use new json library target name

* don't remap the output dirs

* undo warnings at the source

* set new defaults for jsoncpp

* fix typo in new options

* fix signed comparison mismatch warning

* address random(?) compile failures

saying our std::atomic is not initialized in Debug.cpp
develop
Myk 2022-05-13 13:52:43 -07:00 committed by GitHub
parent 4d08a49afb
commit 8f6522899b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 11 deletions

@ -12,10 +12,11 @@ endif()
add_subdirectory(tthread)
option(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" OFF)
option(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" OFF)
option(JSONCPP_BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF)
option(JSONCPP_BUILD_OBJECT_LIBS "Build jsoncpp_lib as a object library." OFF)
option(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" OFF)
add_subdirectory(jsoncpp-sub EXCLUDE_FROM_ALL)
if(UNIX)
set_target_properties(jsoncpp_lib_static PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
endif()
# build clsocket static and only as a dependency. Setting those options here overrides its own default settings.
option(CLSOCKET_SHARED "Build clsocket lib as shared." OFF)
option(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependency." ON)

@ -1 +1 @@
Subproject commit ddabf50f72cf369bf652a95c4d9fe31a1865a781
Subproject commit ba5eac54136064af94ab4a923ac110d7534d4f83

@ -415,10 +415,10 @@ if(APPLE)
set_target_properties(dfhack PROPERTIES SOVERSION 1.0.0)
endif()
target_link_libraries(dfhack protobuf-lite clsocket lua jsoncpp_lib_static dfhack-version ${PROJECT_LIBS})
target_link_libraries(dfhack protobuf-lite clsocket lua jsoncpp_static dfhack-version ${PROJECT_LIBS})
set_target_properties(dfhack PROPERTIES INTERFACE_LINK_LIBRARIES "")
target_link_libraries(dfhack-client protobuf-lite clsocket jsoncpp_lib_static)
target_link_libraries(dfhack-client protobuf-lite clsocket jsoncpp_static)
target_link_libraries(dfhack-run dfhack-client)
if(APPLE)

@ -198,7 +198,7 @@ DebugCategory::cstring_ref DebugCategory::plugin() const noexcept
//! standards only provide runtime checks if an atomic type is lock free
struct failIfEnumAtomicIsNotLockFree {
failIfEnumAtomicIsNotLockFree() {
std::atomic<DebugCategory::level> test;
std::atomic<DebugCategory::level> test(DebugCategory::LINFO);
if (test.is_lock_free())
return;
std::cerr << __FILE__ << ':' << __LINE__

@ -87,7 +87,7 @@ if(BUILD_SUPPORTED)
dfhack_plugin(autoclothing autoclothing.cpp)
dfhack_plugin(autodump autodump.cpp)
dfhack_plugin(autofarm autofarm.cpp)
dfhack_plugin(autogems autogems.cpp LINK_LIBRARIES jsoncpp_lib_static)
dfhack_plugin(autogems autogems.cpp LINK_LIBRARIES jsoncpp_static)
dfhack_plugin(autohauler autohauler.cpp)
dfhack_plugin(autolabor autolabor.cpp)
dfhack_plugin(automaterial automaterial.cpp LINK_LIBRARIES lua)
@ -109,7 +109,7 @@ if(BUILD_SUPPORTED)
dfhack_plugin(cursecheck cursecheck.cpp)
dfhack_plugin(cxxrandom cxxrandom.cpp LINK_LIBRARIES lua)
dfhack_plugin(deramp deramp.cpp)
dfhack_plugin(debug debug.cpp LINK_LIBRARIES jsoncpp_lib_static)
dfhack_plugin(debug debug.cpp LINK_LIBRARIES jsoncpp_static)
dfhack_plugin(dig dig.cpp)
dfhack_plugin(dig-now dig-now.cpp LINK_LIBRARIES lua)
dfhack_plugin(digFlood digFlood.cpp)
@ -143,7 +143,7 @@ if(BUILD_SUPPORTED)
dfhack_plugin(mode mode.cpp)
dfhack_plugin(mousequery mousequery.cpp)
dfhack_plugin(nestboxes nestboxes.cpp)
dfhack_plugin(orders orders.cpp LINK_LIBRARIES jsoncpp_lib_static)
dfhack_plugin(orders orders.cpp LINK_LIBRARIES jsoncpp_static)
dfhack_plugin(pathable pathable.cpp LINK_LIBRARIES lua)
dfhack_plugin(petcapRemover petcapRemover.cpp)
dfhack_plugin(plants plants.cpp)

@ -873,7 +873,7 @@ static void assign_labor(unit_labor::unit_labor labor,
}
int pool = labor_infos[labor].talent_pool();
if (pool < 200 && candidates.size() > 1 && abs(pool) < candidates.size())
if (pool < 200 && candidates.size() > 1 && size_t(abs(pool)) < candidates.size())
{
// Sort in descending order
std::sort(candidates.begin(), candidates.end(), [&](const int lhs, const int rhs) -> bool {