-
Notifications
You must be signed in to change notification settings - Fork 187
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
Add restinio package #503
base: master
Are you sure you want to change the base?
Add restinio package #503
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[ | ||
{ "example": "foo", "toolchain": "clang-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "gcc-7-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "gcc-8-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "gcc-9-cxx17-fpic", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "android-ndk-r17-api-24-arm64-v8a-clang-libcxx14", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "analyze-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "sanitize-address-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "sanitize-leak-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "sanitize-thread-cxx17", "os": "ubuntu-20.04", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "osx-10-15-make-cxx14", "os": "macos-10.15", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "osx-11-1-arch-universal2-cxx17", "os": "macos-10.15", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "ios-nocodesign-14-4-dep-10-0-arm64", "os": "macos-10.15", "python": "3.8", "script": "build.sh" }, | ||
{ "example": "foo", "toolchain": "ninja-vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "foo", "toolchain": "nmake-vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "foo", "toolchain": "vs-16-2019-win64-sdk-10-0-18362-0-cxx17", "os": "windows-2019", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "foo", "toolchain": "vs-15-2017-win64-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" }, | ||
// { "example": "foo", "toolchain": "vs-14-2015-sdk-8-1", "os": "windows-2016", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "foo", "toolchain": "mingw-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" }, | ||
{ "example": "foo", "toolchain": "msys-cxx17", "os": "windows-2016", "python": "3.8", "script": "build.cmd" } | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) 2021 Niall Douglas https://www.nedproductions.biz/ | ||
# All rights reserved. | ||
|
||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
include(hunter_add_version) | ||
include(hunter_cacheable) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
|
||
hunter_add_version( | ||
PACKAGE_NAME | ||
restinio | ||
VERSION | ||
0.6.14 | ||
URL | ||
"https://github.com/cpp-pm/restinio/archive/0.6.14-hunter.tar.gz" | ||
SHA1 | ||
9d74b30969162a4506a7f516105a9404cafd6fc5 | ||
) | ||
|
||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
hunter_cacheable(restinio) | ||
hunter_download(PACKAGE_NAME restinio) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.. spelling:: | ||
|
||
restinio | ||
|
||
.. index:: networking ; restinio | ||
|
||
.. _pkg.restinio: | ||
|
||
restinio | ||
======== | ||
|
||
- `Official <https://github.com/Stiffstream/restinio>`__ | ||
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/restinio/CMakeLists.txt>`__ | ||
|
||
.. code-block:: cmake | ||
|
||
find_package(Threads REQUIRED) | ||
|
||
hunter_add_package(asio) | ||
find_package(asio CONFIG REQUIRED) | ||
|
||
hunter_add_package(http-parser) | ||
find_package(http-parser CONFIG REQUIRED) | ||
|
||
hunter_add_package(fmt) | ||
find_package(fmt CONFIG REQUIRED) | ||
|
||
hunter_add_package(restinio) | ||
find_package(restinio CONFIG REQUIRED) | ||
target_link_libraries(... restinio::restinio) | ||
|
||
The reason you must manually bring in restinio's dependencies is because | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dependencies are normally done by the hunterized package. The user of the package shouldn't need to specify dependencies by hand. Please hunterize restinio package instead following the documentation https://hunter.readthedocs.io/en/latest/creating-new/create/cmake-dependencies.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As my comment in the docs notes, restinio is an INTERFACE library. Therefore, its cmake dependencies get exported with the target. restinio is fully hunterised, see https://github.com/ned14/restinio/blob/master/CMakeLists.txt. This isn't the problem here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can still add dependencies through the |
||
it is a header only library defined as an INTERFACE cmake target. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2021 Niall Douglas | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/cpp-pm/gate | ||
include("../common.cmake") | ||
|
||
project(download-restinio) | ||
find_package(Threads REQUIRED) | ||
|
||
hunter_add_package(asio) | ||
find_package(asio CONFIG REQUIRED) | ||
|
||
hunter_add_package(http-parser) | ||
find_package(http-parser CONFIG REQUIRED) | ||
|
||
hunter_add_package(fmt) | ||
find_package(fmt CONFIG REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see remark above about hunter dependencies, please hnunterize the restinio package There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is fully hunterised. |
||
|
||
hunter_add_package(restinio) | ||
find_package(restinio CONFIG REQUIRED) | ||
|
||
add_executable(foo foo.cpp) | ||
target_link_libraries(foo PUBLIC restinio::restinio) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <restinio/all.hpp> | ||
int main() | ||
{ | ||
restinio::run( | ||
restinio::on_this_thread() | ||
.port(8080) | ||
.address("localhost") | ||
.request_handler([](auto req) { | ||
return req->create_response().set_body("Hello, World!").done(); | ||
})); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this file is needed. I thought there is a default
matrix.json
and this override is only needed if you need to change toolchainsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restinio is not compatible with VS2015, hence me commenting it out. If there is a better way to do this, I'd be glad to hear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it should not be needed