ArthurSonzogni / nlohmann_json_cmake_fetchcontent

A lightweight Release-tracking repository for nlohmann/json. Suitable for CMake fetchcontent. Automatically upgraded every weeks.
MIT License
79 stars 25 forks source link

json_fwd.hpp broken since v3.11.0 #14

Closed insensiv-ah closed 8 months ago

insensiv-ah commented 1 year ago

Since v3.11.0 the json_fwd.hpp contains an include of nlohmann/detail/abi_macros.hpp which is of course missing from this repo. As a result including json_fwd.hpp fails.

While the amalgamated json_fwd.hpp is missing from v3.11.0 and v3.11.1 in the original repo, there's one for v3.11.2 with the include correctly amalgamated: nlohmann/json/.../json_fwd.hpp

csfend commented 9 months ago

@ArthurSonzogni This issue appears to still exist. Adding the following lines to the if tag >= "v3.10.5": path in update.py fixes the issue by copying abi_macros.hpp to the expected path:

os.system("mkdir ./single_include/nlohmann/detail/")
os.system("cp -rf ./tmp/include/nlohmann/detail/abi_macros.hpp ./single_include/nlohmann/detail/")
ArthurSonzogni commented 8 months ago

This repository is not more useful. Indeed, since v3.11.3, you can use:

include(FetchContent)

FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)

target_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)

directly.