mirror of
https://github.com/nlohmann/json.git
synced 2026-08-21 16:43:17 +00:00
deploy: 981a4c39f4
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
cc_binary(
|
||||
name = "main",
|
||||
srcs = ["example.cpp"],
|
||||
deps = ["@nlohmann_json//:json"],
|
||||
)
|
||||
@@ -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",
|
||||
)
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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)
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[requires]
|
||||
nlohmann_json/3.7.3
|
||||
nlohmann_json/3.11.3
|
||||
|
||||
[generators]
|
||||
cmake
|
||||
CMakeToolchain
|
||||
CMakeDeps
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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)
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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)
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
@@ -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
@@ -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)
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user