-
Notifications
You must be signed in to change notification settings - Fork 90
build: add Meson build support and export a C++20 module interface #240
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
lozkoev
wants to merge
4
commits into
minio:main
Choose a base branch
from
lozkoev:main
base: main
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.
+129
−8
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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,57 @@ | ||
| project('miniocpp', 'cpp', version : '0.4.0') | ||
|
|
||
| cxx = meson.get_compiler('cpp') | ||
|
|
||
| openssl_dep = dependency('openssl') | ||
| curlpp_dep = dependency('curlpp') | ||
| inih_dep = dependency('INIReader') | ||
| nlohmann_json_dep = dependency('nlohmann_json') | ||
| pugixml_dep = dependency('pugixml') | ||
| zlib_dep = dependency('zlib') | ||
|
|
||
| extra_libs = [] | ||
| if host_machine.system() == 'windows' | ||
| extra_libs = [cxx.find_library('ws2_32'), cxx.find_library('wsock32')] | ||
| endif | ||
|
|
||
| all_deps = [openssl_dep, curlpp_dep, inih_dep, nlohmann_json_dep, pugixml_dep, zlib_dep] + extra_libs | ||
| miniocpp_include = include_directories('include') | ||
|
|
||
| miniocpp_sources = files( | ||
| 'src/args.cc', | ||
| 'src/baseclient.cc', | ||
| 'src/client.cc', | ||
| 'src/credentials.cc', | ||
| 'src/error.cc', | ||
| 'src/http.cc', | ||
| 'src/providers.cc', | ||
| 'src/request.cc', | ||
| 'src/response.cc', | ||
| 'src/select.cc', | ||
| 'src/signer.cc', | ||
| 'src/sse.cc', | ||
| 'src/types.cc', | ||
| 'src/utils.cc', | ||
| ) | ||
|
|
||
| # The real library - all .cc files from this repo, not the official minio-cpp | ||
| # vcpkg package. | ||
| miniocpp_lib = static_library('miniocpp', miniocpp_sources, | ||
| include_directories : miniocpp_include, | ||
| dependencies : all_deps, | ||
| ) | ||
|
|
||
| # Module as its own target - /interface only applies to this one file, not to | ||
| # every .cc source. | ||
| miniocpp_module_lib = static_library('miniocpp_module', 'modules/miniocpp.cc', | ||
| include_directories : miniocpp_include, | ||
| dependencies : all_deps, | ||
| cpp_args : cxx.get_id() == 'msvc' ? ['/interface'] : [], | ||
| override_options : ['cpp_std=c++20'], | ||
| ) | ||
|
|
||
| miniocpp_dep = declare_dependency( | ||
| link_with : [miniocpp_lib, miniocpp_module_lib], | ||
| include_directories : miniocpp_include, | ||
| dependencies : all_deps, | ||
| ) | ||
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
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,26 @@ | ||
| module; | ||
|
|
||
| #include <miniocpp/client.h> | ||
|
|
||
| export module miniocpp; | ||
|
|
||
| // Re-exporting the public API through the module requires an EXPLICIT using- | ||
| // declaration per symbol (using ns::Symbol;) - not a using-directive (using | ||
| // namespace ns;), because declarations from the global module fragment (the | ||
| // #include above) only become "reachable", not automatic members of an export | ||
| // namespace. The list below covers what a typical consumer needs today - | ||
| // extend it by adding more using-declarations as needed. | ||
| export namespace minio::s3 { | ||
| using s3::BaseUrl; | ||
| using s3::BucketExistsArgs; | ||
| using s3::BucketExistsResponse; | ||
| using s3::Client; | ||
| } // namespace minio::s3 | ||
|
|
||
| export namespace minio::creds { | ||
| using minio::creds::StaticProvider; | ||
| } | ||
|
|
||
| export namespace minio { | ||
| using minio::Result; | ||
| } |
Oops, something went wrong.
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.