diff --git a/.gitignore b/.gitignore index 06e4aff9..aea66e12 100644 --- a/.gitignore +++ b/.gitignore @@ -94,3 +94,7 @@ gmon.out # QtCreator CMakeLists.txt.user + +# MSVS. + +/.vs \ No newline at end of file diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json index 9633574b..b0b5af20 100644 --- a/.vs/ProjectSettings.json +++ b/.vs/ProjectSettings.json @@ -1,3 +1,3 @@ { - "CurrentProjectSetting": "Windows x64 Debug (windows-default)" -} + "CurrentProjectSetting": "Windows x64 Debug (windows-ninja)" +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index e6a6fb8d..b29c21a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,7 +310,7 @@ add_third_party("gh:p-ranav/csv2@0.1" "CSV2_TEST OFF" "CSV2_SAMPLES OFF") -if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^x86.*") +if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86.*)|(X86.*)|(amd64)|(AMD64)") add_third_party("gh:intel/pcm" GIT_TAG 2f9b0c2 OPTIONS @@ -323,7 +323,7 @@ add_third_party("gh:zeromq/cppzmq@4.10.0" OPTIONS "CPPZMQ_BUILD_TESTS OFF") -add_third_party("gh:Tencent/rapidjson#7c73dd7" +add_third_party("gh:Tencent/rapidjson#ebd87cb" OPTIONS "RAPIDJSON_BUILD_DOC OFF" "RAPIDJSON_BUILD_ASAN OFF" diff --git a/knp/base-framework/CMakeLists.txt b/knp/base-framework/CMakeLists.txt index 215b1f5b..52865c4a 100644 --- a/knp/base-framework/CMakeLists.txt +++ b/knp/base-framework/CMakeLists.txt @@ -76,7 +76,7 @@ knp_add_library("${PROJECT_NAME}-core" ${${PROJECT_NAME}_headers} ALIAS KNP::BaseFramework::Core LINK_PRIVATE - spdlog::spdlog_header_only Boost::headers Boost::filesystem HighFive ${HDF5_LIB} csv2 # RapidJSON + spdlog::spdlog_header_only Boost::headers Boost::filesystem HighFive ${HDF5_LIB} csv2 # Hack to build with CLang. ${ADD_LIBS} LINK_PUBLIC diff --git a/knp/base-framework/impl/storage/native/data_storage_json.cpp b/knp/base-framework/impl/storage/native/data_storage_json.cpp index 45f6a36f..7cb3bbcb 100644 --- a/knp/base-framework/impl/storage/native/data_storage_json.cpp +++ b/knp/base-framework/impl/storage/native/data_storage_json.cpp @@ -140,7 +140,7 @@ bool is_json_has_magic(const rapidjson::Document &doc) // cppcheck-suppress con bool has_magic = false; for (auto group_iter = attributes.Begin(); group_iter != attributes.End(); ++group_iter) { - const auto &group = group_iter->GetObject(); + const auto &group = *group_iter; if (group.HasMember("name") && group["name"].GetString() == magic) { if (group.HasMember("value") && group["value"].GetInt() != MAGIC_NUMBER) break; @@ -163,7 +163,7 @@ bool is_correct_version(const rapidjson::Document &doc) // cppcheck-suppress co for (auto group_iter = attributes.Begin(); group_iter != attributes.End(); ++group_iter) { - const auto &group = group_iter->GetObject(); + const auto &group = *group_iter; if (!group.HasMember("name") || group["name"].GetString() != version_str) continue; if (!group.HasMember("value") || !group["value"].IsArray()) return false; @@ -191,7 +191,7 @@ auto read_nodes(const rapidjson::Document::Object &spikes_group) // Reading node IDs. if (!spikes_group.HasMember("node_ids") || !spikes_group["node_ids"].IsObject()) throw std::runtime_error("No \"node_ids\" array in \"spikes\" group."); - const auto &nodes_ids = spikes_group["node_ids"].GetObject(); + const auto &nodes_ids = spikes_group["node_ids"]; if (!nodes_ids.HasMember("value") || !nodes_ids["value"].IsArray()) throw std::runtime_error("Missing node data in JSON data file."); @@ -253,7 +253,7 @@ KNP_DECLSPEC std::vector load_messages_from_json( if (!doc.HasMember("spikes") || !doc["spikes"].IsObject()) throw std::runtime_error("Unable to find \"spikes\" group in data file."); - const auto &spikes_group = doc["spikes"].GetObject(); + const auto &spikes_group = doc["spikes"].GetObj(); auto nodes = read_nodes(spikes_group); auto timestamps = read_timestamps(spikes_group); diff --git a/knp/devices-library/CMakeLists.txt b/knp/devices-library/CMakeLists.txt index d4aaa2b4..c7fbb729 100644 --- a/knp/devices-library/CMakeLists.txt +++ b/knp/devices-library/CMakeLists.txt @@ -33,7 +33,7 @@ include(knp-functions) set(${PROJECT_NAME}_PUBLIC_INCLUDE_DIR "knp/devices") -if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86.*") +if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86.*)|(X86.*)|(amd64)|(AMD64)") set(${PROJECT_NAME}_CPU_SOURCE impl/x86_cpu.cpp impl/x86_cpu_power.cpp impl/x86_cpu_power.h) set(${PROJECT_NAME}_ADD_LINK_LIBRARIES PCM_STATIC) else()