Skip to content

Conversation

sjanel
Copy link
Contributor

@sjanel sjanel commented Oct 2, 2022

Draft PR dealing with this issue

closes #250

@sjanel sjanel force-pushed the feature/nlohmann-json-dependency branch from 7a05bf3 to 978d65d Compare October 2, 2022 18:28
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.14)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of FetchContent_MakeAvailable

Copy link
Collaborator

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only issue is whitespace

Copy link
Collaborator

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handful of questions/comments about fetchcontent looking into more, let me know if I make sense or i am a complete noob 🙃

CMakeLists.txt Outdated

FetchContent_Declare(
json
GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As much as I understand the benefits, but rather see the real repository.

https://github.com/Kitware/CMake/blob/8251cdfe39c33cbcc38479f0245da3a858a8152f/Modules/FetchContent.cmake#L123

This "first to record, wins" approach is what allows hierarchical projects to have parent projects override content details of child projects.

Suggested change
GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git
GIT_REPOSITORY https://github.com/nlohmann/json.git

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this ? Main repository is really huge and it takes time to download all of it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks more official using the real one, that's just me.

You only pay the price once when you clone + you can install system wide and avoid it (I need to check the logs first) + downstream projects can override it


Don't change it, I think it's good to merge test the performance across the CI workflows can wait for me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks for the review, finally CI is OK ;)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this has already been merged, but I think a good alternative would be to pull the official release tar.
It's official, but unlike the git pull its only a couple hundret K, not a couple hundret megs.
E.g.

FetchContent_Declare(nlohmann_json
    URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz
    DOWNLOAD_EXTRACT_TIMESTAMP OFF
)
FetchContent_MakeAvailable(nlohmann_json)

@prince-chrismc
Copy link
Collaborator

thanks for this amazing PR ❤️

@sjanel sjanel force-pushed the feature/nlohmann-json-dependency branch from 975229f to 7b19091 Compare October 2, 2022 19:42
@sjanel sjanel force-pushed the feature/nlohmann-json-dependency branch from 7b19091 to 453e2d1 Compare October 2, 2022 21:10
@prince-chrismc
Copy link
Collaborator

Please do not force push 🙏 GitHub forces us to restart the review which is not fun!

@prince-chrismc
Copy link
Collaborator

It's working as intended https://github.com/Thalhammer/jwt-cpp/actions/runs/3170117371/jobs/5166681733#step:11:1452

Install is picked no fetch content 🚀

Headers are no longer vendored
@prince-chrismc
Copy link
Collaborator

I'll hit merge assuming I didn't break it lol

@prince-chrismc prince-chrismc merged commit 07a2f64 into Thalhammer:master Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with CMake FetchContent with vendored picojson and nlohmann json files
3 participants