Skip to content

Commit

Permalink
MSVC Support, updated taojson
Browse files Browse the repository at this point in the history
  • Loading branch information
Dax89 committed Jan 3, 2021
1 parent 05050d1 commit 71ec192
Show file tree
Hide file tree
Showing 401 changed files with 40 additions and 37,659 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "rdcore/libs/taojson"]
path = rdcore/libs/taojson
url = https://github.com/taocpp/json.git
33 changes: 28 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,37 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_definitions(-DSHARED_OBJECT_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}")

# Core
file(GLOB_RECURSE RDCORE_HEADERS rdcore/*.h*)
file(GLOB_RECURSE RDCORE_SOURCES rdcore/*.c*)
file(GLOB_RECURSE LIBS_HEADERS
rdcore/libs/binutils_demangler/*.h* rdcore/libs/miniz/*.h* rdcore/libs/taojson/include/*.h*
rdcore/libs/undname.h)

file(GLOB_RECURSE LIBS_SOURCES
rdcore/libs/binutils_demangler/*.c* rdcore/libs/miniz/*.c* rdcore/libs/taojson/include/*.c*)

file(GLOB_RECURSE RDCORE_HEADERS
rdcore/buffer/*.h* rdcore/builtin/*.h* rdcore/containers/*.h*
rdcore/database/*.h* rdcore/document/*.h* rdcore/engine/*.h*
rdcore/graph/*.h* rdcore/plugin/*.h* rdcore/rdil/*.h*
rdcore/renderer/*.h* rdcore/support/*.h* rdcore/types/*.h*
rdcore/renderer/*.h* rdcore/config.h rdcore/context.h
rdcore/disassembler.h rdcore/object.h)

file(GLOB_RECURSE RDCORE_SOURCES
rdcore/buffer/*.c* rdcore/builtin/*.c* rdcore/containers/*.c*
rdcore/database/*.c* rdcore/document/*.c* rdcore/engine/*.c*
rdcore/graph/*.c* rdcore/plugin/*.c* rdcore/rdil/*.c*
rdcore/renderer/*.c* rdcore/support/*.c* rdcore/types/*.c*
rdcore/renderer/*.c* rdcore/config.cpp rdcore/context.cpp
rdcore/disassembler.cpp rdcore/object.cpp)

# API
file(GLOB_RECURSE RDAPI_HEADERS rdapi/*.h*)
file(GLOB_RECURSE RDAPI_SOURCES rdapi/*.c*)

set(HEADERS ${RDCORE_HEADERS} ${RDAPI_HEADERS})
set(SOURCES ${RDCORE_SOURCES} ${RDAPI_SOURCES})
set(HEADERS ${LIBS_HEADERS} ${RDCORE_HEADERS} ${RDAPI_HEADERS})
set(SOURCES ${LIBS_SOURCES} ${RDCORE_SOURCES} ${RDAPI_SOURCES})

add_subdirectory(rdcore/libs/taojson)
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})

install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config
Expand Down Expand Up @@ -88,7 +109,9 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} pthread dl tbb)
target_link_libraries(${PROJECT_NAME} pthread dl tbb taocpp::json)
else()
target_link_libraries(${PROJECT_NAME} taocpp::json)
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
Expand Down
9 changes: 5 additions & 4 deletions rdcore/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "../support/compression.h"
#include "../support/utils.h"
#include "../config.h"
#include <tao/pegtl.hpp>
#include <algorithm>
#include <fstream>

Expand Down Expand Up @@ -234,7 +235,7 @@ bool Database::parseDecompiledFile(const fs::path& filepath, tao::json::value& j
try {
j = tao::json::from_file(filepath);
}
catch(tao::json::pegtl::parse_error& e) {
catch(tao::pegtl::parse_error& e) {
rd_cfg->log(e.what());
return false;
}
Expand All @@ -251,7 +252,7 @@ bool Database::parseCompiledFile(const fs::path& filepath, tao::json::value& j)
std::string mp(data.begin(), data.end());
j = tao::json::msgpack::from_string(mp);
}
catch(tao::json::pegtl::parse_error& e) {
catch(tao::pegtl::parse_error& e) {
rd_cfg->log(e.what());
return false;
}
Expand Down Expand Up @@ -291,7 +292,7 @@ fs::path Database::locatePath(const fs::path& dbpath)
return { };
}

fs::path Database::locateAs(fs::path dbpath, const platform_string& ext)
fs::path Database::locateAs(fs::path dbpath, const std::string& ext)
{
dbpath.replace_extension(ext);
if(fs::exists(dbpath)) return dbpath;
Expand All @@ -302,7 +303,7 @@ fs::path Database::locate(fs::path dbpath)
{
if(dbpath.extension().empty())
{
static const std::vector<platform_string> ALLOWED_EXT = {
static const std::vector<std::string> ALLOWED_EXT = {
DATABASE_RDB_EXT, DATABASE_JSON_EXT
};

Expand Down
4 changes: 2 additions & 2 deletions rdcore/database/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <filesystem>
#include <unordered_map>
#include <set>
#include "../libs/tao/json.hpp"
#include <tao/json.hpp>
#include "../types/definitions.h"
#include "../object.h"
#include "../config.h"
Expand Down Expand Up @@ -50,7 +50,7 @@ class Database: public Object
static bool parseCompiledFile(const fs::path &filepath, tao::json::value& j);
static bool parseFile(const fs::path &filepath, tao::json::value& j);
static fs::path locatePath(const fs::path& dbpath);
static fs::path locateAs(fs::path dbpath, const platform_string& ext);
static fs::path locateAs(fs::path dbpath, const std::string& ext);
static fs::path locate(fs::path dbpath);

private:
Expand Down
21 changes: 0 additions & 21 deletions rdcore/libs/tao/LICENSE

This file was deleted.

32 changes: 0 additions & 32 deletions rdcore/libs/tao/LICENSE.double-conversion

This file was deleted.

19 changes: 0 additions & 19 deletions rdcore/libs/tao/LICENSE.itoa

This file was deleted.

45 changes: 0 additions & 45 deletions rdcore/libs/tao/json.hpp

This file was deleted.

Loading

0 comments on commit 71ec192

Please sign in to comment.