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
- Users on macOS and other platforms were default compilers do not provide C++11 compliant by default should request it with the appropriate flag (e.g., `c++ myproject.cpp simdjson.cpp`).
44
48
- 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
50
+
Using simdjson as a CMake dependency
51
+
------------------
52
+
53
+
You can include the simdjson repository as a folder in your CMake project. In the parent
54
+
`CMakeLists.txt` include the following lines:
55
+
56
+
```
57
+
set(SIMDJSON_JUST_LIBRARY ON CACHE STRING "Build just the library, nothing else." FORCE)
58
+
add_subdirectory(simdjson EXCLUDE_FROM_ALL)
59
+
```
60
+
61
+
Elsewhere in your project, you can declare dependencies on simdjson with lines such as these:
62
+
63
+
```
64
+
add_executable(myprogram myprogram.cpp)
65
+
target_link_libraries(myprogram simdjson)
66
+
```
67
+
68
+
See [our CMake demonstration](https://github.com/simdjson/cmakedemo).
46
69
47
70
The Basics: Loading and Parsing JSON Documents
48
71
----------------------------------------------
@@ -168,6 +191,36 @@ And another one:
168
191
cout << "number: " << v << endl;
169
192
```
170
193
194
+
C++17 Support
195
+
-------------
196
+
197
+
While the simdjson library can be used in any project using C++ 11 and above, field iteration has special support C++ 17's destructuring syntax. For example:
@@ -204,37 +257,6 @@ The UTF-8 validation function merely checks that the input is valid UTF-8: it wo
204
257
205
258
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
259
207
-
208
-
C++17 Support
209
-
-------------
210
-
211
-
While the simdjson library can be used in any project using C++ 11 and above, field iteration has special support C++ 17's destructuring syntax. For example:
0 commit comments