mirror of
https://github.com/nlohmann/json.git
synced 2026-07-12 05:25:09 +00:00
deploy: e9c3985f0a
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -175,3 +175,14 @@ Execute the test suite with [Valgrind](https://valgrind.org). This option is `OF
|
||||
### `NLOHMANN_JSON_BUILD_MODULES`
|
||||
|
||||
Build the experimental [C++ module](https://json.nlohmann.me/features/modules/index.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:
|
||||
|
||||
```
|
||||
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