mirror of
https://github.com/nlohmann/json.git
synced 2026-07-12 05:25:09 +00:00
deploy: e9c3985f0a
This commit is contained in:
@@ -181,3 +181,15 @@ Execute the test suite with [Valgrind](https://valgrind.org). This option is `OF
|
||||
|
||||
Build the experimental [C++ module](../features/modules.md) `nlohmann.json` (requires CMake 3.28 or later and C++20).
|
||||
This option is `OFF` by default.
|
||||
|
||||
A consuming project must link the dedicated `nlohmann_json_modules` CMake target (not just
|
||||
`nlohmann_json::nlohmann_json`) for `import nlohmann.json;` to resolve:
|
||||
|
||||
```cmake
|
||||
set(NLOHMANN_JSON_BUILD_MODULES ON)
|
||||
add_subdirectory(path/to/json)
|
||||
|
||||
add_executable(myproject main.cpp)
|
||||
target_link_libraries(myproject PRIVATE nlohmann_json_modules)
|
||||
target_compile_definitions(myproject PRIVATE NLOHMANN_JSON_BUILD_MODULES)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user