-
Notifications
You must be signed in to change notification settings - Fork 2k
Add reduct-cpp #27398
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
Open
victor1234
wants to merge
17
commits into
conan-io:master
Choose a base branch
from
victor1234:add-reduct-cpp-recipe
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+196
−0
Open
Add reduct-cpp #27398
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
623d352
feat(reduct-cpp): add recipe
victor1234 3ba4a33
fix(conanfile): fix attributes, requirements(), layout(), add require…
victor1234 bdfc6f4
feat(test_package): add test_package
victor1234 49d687a
fix(conanfile): add validate() with c++20 check
victor1234 0363d69
fix(conanfile): remove license
victor1234 0c10b27
fix(conanfile): add rmfiles in package()
victor1234 ff2bc3a
fix(conanfile): add license copy
victor1234 1eda515
fix(conanfile): add packages options check to validate()
victor1234 58b9f56
fix(coanfile): set cmake_file_name, target name in package_info()
victor1234 ab51967
fix(conanfile): add gcc version + with_chrono validation, remove conf…
victor1234 6ed9100
chore(conanfile): format
victor1234 63f6f5a
fix(coanfile): improve validate()
victor1234 095db0d
Changes
AbrilRBS b94c9ff
Typo
AbrilRBS 052bcf1
Add missing transitive headers and libs
AbrilRBS fbb2b4a
Remove unused import
AbrilRBS 3ce295c
Final cleanups, make chrono a non option in Windows
AbrilRBS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Reduct Storage | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"1.15.0": | ||
url: "https://github.com/reductstore/reduct-cpp/archive/refs/tags/v1.15.0.tar.gz" | ||
sha256: "120caa687389b6a0f9d05b1d1b8670640e63aaeaf2463714427d7cd353220b86" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
from os.path import join | ||
|
||
from conan import ConanFile | ||
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout | ||
from conan.tools.files import copy | ||
from conan.tools.files import get | ||
|
||
|
||
class ReductCppConan(ConanFile): | ||
name = "reduct-cpp" | ||
description = "Reduct Storage Client SDK for C++" | ||
license = "MIT" | ||
url = "https://github.com/reduct-storage/reduct-cpp" | ||
homepage = "https://www.reduct.store/docs/getting-started/with-cpp" | ||
author = "Alexey Timin" | ||
topics = ("reduct-storage", "http-client", "http-api") | ||
package_type = "library" | ||
settings = "os", "compiler", "build_type", "arch" | ||
options = { | ||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
"with_chrono": [True, False], | ||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
"with_chrono": False, | ||
"cpp-httplib/*:with_openssl": True, | ||
"cpp-httplib/*:with_zlib": True, | ||
"date/*:header_only": True, | ||
} | ||
|
||
requires = ( | ||
"fmt/11.0.2", | ||
"cpp-httplib/0.16.0", | ||
"nlohmann_json/3.11.3", | ||
"openssl/3.2.2", | ||
"concurrentqueue/1.0.4", | ||
) | ||
|
||
def config_options(self): | ||
if self.settings.get_safe("os") == "Windows": | ||
self.options.rm_safe("fPIC") | ||
self.options.with_chrono = True | ||
elif ( | ||
self.settings.get_safe("compiler") == "gcc" | ||
and self.settings.get_safe("compiler.version") >= "14" | ||
): | ||
self.options.with_chrono = True | ||
|
||
def requirements(self): | ||
if not self.options.with_chrono: | ||
self.requires("date/3.0.1") | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def generate(self): | ||
deps = CMakeDeps(self) | ||
deps.generate() | ||
tc = CMakeToolchain(self) | ||
if self.options.with_chrono: | ||
tc.variables["REDUCT_CPP_USE_STD_CHRONO"] = "ON" | ||
tc.generate() | ||
|
||
def source(self): | ||
get(self, **self.conan_data["sources"][self.version], strip_root=True) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def package(self): | ||
cmake = CMake(self) | ||
cmake.install() | ||
|
||
copy(self, "LICENSE", src=self.source_folder, dst=join(self.package_folder, "licenses")) | ||
|
||
def package_info(self): | ||
self.cpp_info.libs = ["reductcpp"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"1.15.0": | ||
folder: all |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.