Skip to content

Add header-only Meson support #955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2021
Merged

Add header-only Meson support #955

merged 2 commits into from
Jun 5, 2021

Conversation

Tachi107
Copy link
Contributor

@Tachi107 Tachi107 commented Jun 5, 2021

This allows users to call dependency('httplib') and have the include directory automatically configured.

This doesn't add any advanced functionality (as you can see by the diff) so there's nothing to maintain (unless you move httplib.h in a separate directory; in that case include_directories('.') should be changed to include_directories('newdir')). In fact, it only makes users' life simpler :)

This allows users to call `dependency('httplib')` and have the include
directory automatically configured
@yhirose
Copy link
Owner

yhirose commented Jun 5, 2021

@Tachi107, thank you for your pull request, but I am probably not taking it... Please see this comment.

@Tachi107
Copy link
Contributor Author

Tachi107 commented Jun 5, 2021

Yep I saw it, but this is to allow Meson users to use the project more easily, it doesn't change the repo's workflow

@Tachi107
Copy link
Contributor Author

Tachi107 commented Jun 5, 2021

It works like this: users can add this repo as a git submodule in a folder called subprojects, and when they want to use this project they can simply add dependency('httplib') to the list of dependencies of their executable/build target.

executable(
  'my-program',
  sources: 'main.cpp',
  dependencies: dependency('httplib')
)

@yhirose
Copy link
Owner

yhirose commented Jun 5, 2021

@Tachi107, thanks for the comment. Please see the former discussion about the current CMake support, so that you would understand what I was trying to say.

As for CMake, I don't touch it at all, but @sum01 has been kindly and faithfully maintaining it for me up till now when any requests or problem reports come. Likewise, if you would like to accept the same responsibility regarding the Meson support, I am glad to merge it. Please let me know your answer.

Thanks for your understanding!

@Tachi107
Copy link
Contributor Author

Tachi107 commented Jun 5, 2021

I implemented only the bare minimum, so it wouldn't be hard to maintain; happy to accept the responsibility :)

Before merging I have a question though, how should the project be called? "cpp-httplib" or "httplib"?

@yhirose
Copy link
Owner

yhirose commented Jun 5, 2021

@Tachi107, great! I chose "cpp-????" as cmake project names in other cpp projects (cpp-peglib, cpp-fstlib and so on). But the current CMakeLists.txt maintained by @sum01 sets the project name to "httplib". So you can pick either one, since I don't have a strong opinion about it. :)
Please let me know when you think the pr is ready to merge.

@Tachi107
Copy link
Contributor Author

Tachi107 commented Jun 5, 2021

I prefer "cpp-httplib" as it is the same name as the repo, and makes Meson's automatic fallback work without issues.

Ready to merge!

@yhirose yhirose merged commit 1a2faf0 into yhirose:master Jun 5, 2021
@yhirose
Copy link
Owner

yhirose commented Jun 5, 2021

I have just merged it. Thanks for the fine contribution!

@Tachi107 Tachi107 deleted the meson branch June 5, 2021 20:46
@yhirose yhirose mentioned this pull request Jan 21, 2023
ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this pull request May 2, 2023
* Add header-only Meson support
This allows users to call `dependency('httplib')` and have the include
directory automatically configured

* Rename `httplib` to `cpp-httplib`
SC-One pushed a commit to SC-One/cpp-httplib that referenced this pull request Jan 15, 2025
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.

2 participants