-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[aws-sdk-cpp] package files for building SDK plugins #7830
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 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 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 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
44 changes: 44 additions & 0 deletions
44
recipes/aws-sdk-cpp/all/patches/1.8.130-0005-aws-plugin-conf.patch
This file contains 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,44 @@ | ||
commit 1179cb040d6b9292d30eb7d444298cd286f9f574 | ||
Author: dvirtz <dvirtz@gmail.com> | ||
Date: Tue Nov 16 21:38:45 2021 +0200 | ||
|
||
add a file to configure SDK plugins | ||
|
||
diff --git a/cmake/sdk_plugin_conf.cmake b/cmake/sdk_plugin_conf.cmake | ||
new file mode 100644 | ||
index 0000000000..474ead75bd | ||
--- /dev/null | ||
+++ b/cmake/sdk_plugin_conf.cmake | ||
@@ -0,0 +1,32 @@ | ||
+get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) | ||
+set(SIMPLE_INSTALL TRUE) | ||
+ | ||
+if (CMAKE_INSTALL_BINDIR) | ||
+ set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}") | ||
+endif() | ||
+ | ||
+if (CMAKE_INSTALL_LIBDIR) | ||
+ set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") | ||
+endif() | ||
+ | ||
+if (CMAKE_INSTALL_INCLUDEDIR) | ||
+ set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}") | ||
+endif() | ||
+ | ||
+if(BUILD_SHARED_LIBS) | ||
+ set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}") | ||
+else() | ||
+ set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") | ||
+endif() | ||
+ | ||
+if(DEFINED CMAKE_CXX_STANDARD) | ||
+ set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD}) | ||
+else() | ||
+ set(STANDARD_DEFAULT "11") | ||
+endif() | ||
+set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.") | ||
+ | ||
+include(CMakePackageConfigHelpers) | ||
+include(initialize_project_version) | ||
+include(utilities) | ||
+include(compiler_settings) |
44 changes: 44 additions & 0 deletions
44
recipes/aws-sdk-cpp/all/patches/1.9.100-0002-aws-plugin-conf.patch
This file contains 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,44 @@ | ||
commit 1179cb040d6b9292d30eb7d444298cd286f9f574 | ||
Author: dvirtz <dvirtz@gmail.com> | ||
Date: Tue Nov 16 21:38:45 2021 +0200 | ||
|
||
add a file to configure SDK plugins | ||
|
||
diff --git a/cmake/sdk_plugin_conf.cmake b/cmake/sdk_plugin_conf.cmake | ||
new file mode 100644 | ||
index 0000000000..474ead75bd | ||
--- /dev/null | ||
+++ b/cmake/sdk_plugin_conf.cmake | ||
@@ -0,0 +1,32 @@ | ||
+get_filename_component(AWS_NATIVE_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) | ||
+set(SIMPLE_INSTALL TRUE) | ||
+ | ||
+if (CMAKE_INSTALL_BINDIR) | ||
+ set(BINARY_DIRECTORY "${CMAKE_INSTALL_BINDIR}") | ||
+endif() | ||
+ | ||
+if (CMAKE_INSTALL_LIBDIR) | ||
+ set(LIBRARY_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") | ||
+endif() | ||
+ | ||
+if (CMAKE_INSTALL_INCLUDEDIR) | ||
+ set(INCLUDE_DIRECTORY "${CMAKE_INSTALL_INCLUDEDIR}") | ||
+endif() | ||
+ | ||
+if(BUILD_SHARED_LIBS) | ||
+ set(ARCHIVE_DIRECTORY "${BINARY_DIRECTORY}") | ||
+else() | ||
+ set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}") | ||
+endif() | ||
+ | ||
+if(DEFINED CMAKE_CXX_STANDARD) | ||
+ set(STANDARD_DEFAULT ${CMAKE_CXX_STANDARD}) | ||
+else() | ||
+ set(STANDARD_DEFAULT "11") | ||
+endif() | ||
+set(CPP_STANDARD ${STANDARD_DEFAULT} CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.") | ||
+ | ||
+include(CMakePackageConfigHelpers) | ||
+include(initialize_project_version) | ||
+include(utilities) | ||
+include(compiler_settings) |
This file contains 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
16 changes: 16 additions & 0 deletions
16
recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.cpp
This file contains 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,16 @@ | ||
#include "AwsSdkCppPlugin.h" | ||
#include <aws/core/auth/AWSAuthSigner.h> | ||
#include <aws/core/auth/AWSCredentialsProviderChain.h> | ||
#include <aws/core/client/ClientConfiguration.h> | ||
#include <aws/s3/S3Client.h> | ||
|
||
AwsSdkCppPlugin::AwsSdkCppPlugin() { | ||
using namespace Aws; | ||
using namespace Auth; | ||
using namespace Client; | ||
using namespace S3; | ||
ClientConfiguration config; | ||
auto client = MakeShared<S3Client>("S3Client", | ||
MakeShared<DefaultAWSCredentialsProviderChain>("S3Client"), config, | ||
AWSAuthV4Signer::PayloadSigningPolicy::Never /*signPayloads*/, true /*useVirtualAddressing*/, US_EAST_1_REGIONAL_ENDPOINT_OPTION::LEGACY); | ||
} |
7 changes: 7 additions & 0 deletions
7
recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.h
This file contains 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,7 @@ | ||
#include <aws_sdk_cpp_plugin_export.h> | ||
|
||
class AWS_SDK_CPP_PLUGIN_EXPORT AwsSdkCppPlugin | ||
{ | ||
public: | ||
AwsSdkCppPlugin(); | ||
}; |
14 changes: 14 additions & 0 deletions
14
recipes/aws-sdk-cpp/all/test_package/aws-sdk-cpp-plugin/CMakeLists.txt
This file contains 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,14 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
add_project(aws-sdk-cpp-plugin "C++ AWS SDK plugin" AWS::aws-sdk-cpp-s3) | ||
|
||
add_library(${PROJECT_NAME} AwsSdkCppPlugin.cpp) | ||
|
||
include(GenerateExportHeader) | ||
generate_export_header(${PROJECT_NAME} BASE_NAME aws_sdk_cpp_plugin) | ||
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) | ||
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_LIBS}) | ||
|
||
setup_install() | ||
|
||
do_packaging() |
This file contains 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
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.
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.
You already test the plugin functionality in
test_package/aws-sdk-cpp-plugin/AwsSdkCppPlugin.cpp
.Can this example remain as-is?
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.
In order to have some code in the plugin and avoid code duplication I've moved this code to the plugin and linked the example against it.