Silence spurious warning and enable JSON_DIAGNOSTICS everywhere

This commit is contained in:
Guillaume Meunier
2024-11-26 23:59:35 +01:00
committed by Patrick Nicolas
parent 8a48f8ff7b
commit d2ff28f988
4 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -290,7 +290,7 @@ foreach(TARGET_NAME wivrn wivrn-server wivrn-dashboard wivrn-common wivrn-dissec
-Wno-comment
-Wno-unused-variable
-Wno-sign-compare
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-volatile>
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-volatile -Wno-array-bounds>
$<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-deprecated-volatile -Wno-unneeded-internal-declaration -Wno-c99-extensions -Wno-unused-private-field>
)
+2
View File
@@ -68,6 +68,8 @@ target_link_libraries(wivrn-dashboard PRIVATE
wivrn-common-base
)
target_compile_definitions(wivrn-dashboard PRIVATE JSON_DIAGNOSTICS=1)
if (WIVRN_CHECK_CAPSYSNICE)
target_link_libraries(wivrn-dashboard PRIVATE PkgConfig::libcap)
endif()
+2
View File
@@ -199,6 +199,8 @@ target_link_libraries(
nlohmann_json::nlohmann_json
)
target_compile_definitions(wivrn-server PRIVATE JSON_DIAGNOSTICS=1)
configure_file(dist/wivrn.service.in wivrn.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/wivrn.service
DESTINATION lib/systemd/user/)
+2 -5
View File
@@ -18,10 +18,7 @@
*/
#define JSON_DISABLE_ENUM_SERIALIZATION 1
#ifdef JSON_DIAGNOSTICS
#undef JSON_DIAGNOSTICS
#endif
#define JSON_DIAGNOSTICS 1
#include <algorithm>
#include <filesystem>
#include <fstream>
@@ -216,7 +213,7 @@ static void save_keys(const std::vector<headset_key> & keys)
for (const auto & key: keys)
{
json.push_back(nlohmann::json{
json.push_back({
{"key", key.public_key},
{"name", key.name},
});