You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Visual Studio users should compile with the `_CRT_SECURE_NO_WARNINGS` flag to avoid warnings with respect to our use of standard C functions such as `fopen`.
45
49
46
50
51
+
52
+
53
+
Using simdjson as a CMake dependency
54
+
------------------
55
+
56
+
57
+
58
+
You can include the simdjson repository as a folder in your CMake project. In the parent
59
+
`CMakeLists.txt` include the following lines:
60
+
61
+
```
62
+
set(SIMDJSON_JUST_LIBRARY ON CACHE STRING "Build just the library, nothing else." FORCE)
63
+
add_subdirectory(simdjson EXCLUDE_FROM_ALL)
64
+
```
65
+
66
+
Elsewhere in your project, you can declare dependencies on simdjson with lines such as these:
67
+
68
+
```
69
+
add_executable(myprogram myprogram.cpp)
70
+
71
+
target_link_libraries(myprogram simdjson)
72
+
```
73
+
74
+
See [our CMake demonstration](https://github.com/simdjson/cmakedemo).
75
+
47
76
The Basics: Loading and Parsing JSON Documents
48
77
----------------------------------------------
49
78
@@ -168,6 +197,38 @@ And another one:
168
197
cout << "number: " << v << endl;
169
198
```
170
199
200
+
C++17 Support
201
+
-------------
202
+
203
+
While the simdjson library can be used in any project using C++ 11 and above, it has special support
204
+
for C++ 17. The APIs for field iteration and error handling in particular are designed to work
205
+
nicely with C++17's destructuring syntax. For example:
@@ -205,38 +266,6 @@ The UTF-8 validation function merely checks that the input is valid UTF-8: it wo
205
266
Your input string does not need any padding. Any string will do. The `validate_utf8` function does not do any memory allocation on the heap, and it does not throw exceptions.
206
267
207
268
208
-
C++17 Support
209
-
-------------
210
-
211
-
While the simdjson library can be used in any project using C++ 11 and above, it has special support
212
-
for C++ 17. The APIs for field iteration and error handling in particular are designed to work
213
-
nicely with C++17's destructuring syntax. For example:
0 commit comments