Skip to content

Add header-only Meson support - #955

Merged
yhirose merged 2 commits into
yhirose:masterfrom
Tachi107:meson
Jun 5, 2021
Merged

yhirose merged 2 commits into
yhirose:masterfrom
Tachi107:meson

Conversation

@Tachi107

@Tachi107 Tachi107 commented Jun 5, 2021 •

Copy link
Copy Markdown
Contributor

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

yhirose commented Jun 5, 2021

Copy link
Copy Markdown
Owner

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

@Tachi107

Tachi107 commented Jun 5, 2021

Copy link
Copy Markdown
Contributor Author

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

Tachi107 commented Jun 5, 2021

Copy link
Copy Markdown
Contributor Author

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

yhirose commented Jun 5, 2021

Copy link
Copy Markdown
Owner

@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

Tachi107 commented Jun 5, 2021

Copy link
Copy Markdown
Contributor Author

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

yhirose commented Jun 5, 2021 •

Copy link
Copy Markdown
Owner

@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

Tachi107 commented Jun 5, 2021

Copy link
Copy Markdown
Contributor Author

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

yhirose commented Jun 5, 2021

Copy link
Copy Markdown
Owner

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`
@yhirose yhirose mentioned this pull request Dec 9, 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