1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-29 23:01:16 +03:00
This commit is contained in:
nlohmann
2024-12-10 08:42:33 +00:00
parent b014c90f94
commit ab14172173
270 changed files with 1412 additions and 1034 deletions

5
integration/bazel/BUILD Normal file
View File

@ -0,0 +1,5 @@
cc_binary(
name = "main",
srcs = ["example.cpp"],
deps = ["@nlohmann_json//:json"],
)

View File

@ -0,0 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "nlohmann_json",
urls = ["https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz"],
strip_prefix = "json-3.11.3",
)

View File

@ -0,0 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << std::setw(4) << json::meta() << std::endl;
}

View File

@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(json_example)
find_package(nlohmann_json REQUIRED)
add_executable(json_example example.cpp)
target_link_libraries(json_example PRIVATE nlohmann_json::nlohmann_json)

View File

@ -0,0 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << std::setw(4) << json::meta() << std::endl;
}

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(json_example)
cmake_minimum_required(VERSION 2.8.12)
add_definitions("-std=c++11")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
find_package(nlohmann_json REQUIRED)
add_executable(json_example example.cpp)
target_link_libraries(json_example ${CONAN_LIBS})
target_link_libraries(json_example PRIVATE nlohmann_json::nlohmann_json)

View File

@ -1,5 +1,6 @@
[requires]
nlohmann_json/3.7.3
nlohmann_json/3.11.3
[generators]
cmake
CMakeToolchain
CMakeDeps

View File

@ -1,9 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << json::meta() << std::endl;
std::cout << std::setw(4) << json::meta() << std::endl;
}

View File

@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.15)
project(json_example)
include(${CMAKE_SOURCE_DIR}/cmake/CPM.cmake)
CPMAddPackage("gh:nlohmann/json@3.11.3")
add_executable(json_example example.cpp)
target_link_libraries(json_example PRIVATE nlohmann_json::nlohmann_json)

View File

@ -0,0 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << std::setw(4) << json::meta() << std::endl;
}

View File

@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(json_example)
find_package(nlohmann_json CONFIG REQUIRED)
add_executable(json_example example.cpp)
target_link_libraries(json_example PRIVATE nlohmann_json::nlohmann_json)

View File

@ -0,0 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << std::setw(4) << json::meta() << std::endl;
}

View File

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.15)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.297.tar.gz"
SHA1 "3319fe6a3b08090df7df98dee75134d68e2ef5a3"
)
project(json_example)
hunter_add_package(nlohmann_json)
find_package(nlohmann_json CONFIG REQUIRED)
add_executable(json_example example.cpp)
target_link_libraries(json_example PRIVATE nlohmann_json::nlohmann_json)

View File

@ -0,0 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << std::setw(4) << json::meta() << std::endl;
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << std::setw(4) << json::meta() << std::endl;
}

View File

@ -0,0 +1,12 @@
project('json_example', 'cpp',
version: '1.0',
default_options: ['cpp_std=c++11']
)
dependency_json = dependency('nlohmann_json', required: true)
executable('json_example',
sources: ['example.cpp'],
dependencies: [dependency_json],
install: true
)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(json_example)
find_package(nlohmann_json REQUIRED)
add_executable(json_example example.cpp)
target_link_libraries(json_example PRIVATE nlohmann_json::nlohmann_json)

View File

@ -0,0 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << std::setw(4) << json::meta() << std::endl;
}

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15)
project(json_example)
cmake_minimum_required(VERSION 2.8.12)
find_package(nlohmann_json CONFIG REQUIRED)

View File

@ -1,9 +1,10 @@
#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
using json = nlohmann::json;
int main()
{
std::cout << json::meta() << std::endl;
std::cout << std::setw(4) << json::meta() << std::endl;
}