Skip to content

Commit 7ae7c88

Browse files
2 parents 91fb62d + 991f46e commit 7ae7c88

File tree

4 files changed

+36
-41
lines changed

4 files changed

+36
-41
lines changed

aws-cpp-sdk-s3-encryption-tests/CryptoModulesTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ namespace
5252
static size_t const CBC_IV_SIZE_BYTES = 16u;
5353

5454
#ifndef ENABLE_COMMONCRYPTO_ENCRYPTION
55-
#ifndef NDEBUG
55+
#if !defined(NDEBUG) && !defined(GTEST_PSEUDO_WINDOWS)
5656
static const char* const BYTES_SPECIFIER = "bytes=0-10";
5757
static const char* const ASSERTION_FAILED = "Assertion .*";
58-
#endif // NDEBUG
58+
#endif // !defined(NDEBUG) && !defined(GTEST_PSEUDO_WINDOWS)
5959
static const char* const GET_RANGE_SPECIFIER = "bytes=20-40";
6060
static const char* const GET_RANGE_OUTPUT = "ge for encryption and";
6161
static size_t const GCM_TAG_LENGTH = 128u;
@@ -714,7 +714,7 @@ namespace
714714
ASSERT_EQ(kmsClient->m_decryptCalledCount, 1u);
715715
}
716716

717-
#ifndef NDEBUG
717+
#if !defined(NDEBUG) && !defined(GTEST_PSEUDO_WINDOWS)
718718
TEST_F(CryptoModulesTest, StrictAERangeGet)
719719
{
720720
SimpleEncryptionMaterials materials(Aws::Utils::Crypto::SymmetricCipher::GenerateKey());
@@ -829,7 +829,7 @@ namespace
829829
auto getObjectFunction = [&s3Client](Aws::S3::Model::GetObjectRequest getRequest) -> Aws::S3::Model::GetObjectOutcome { return s3Client.GetObject(getRequest); };
830830
ASSERT_DEATH({ decryptionModule->GetObjectSecurely(getRequest, headOutcome.GetResult(), contentCryptoMaterial, getObjectFunction); }, ASSERTION_FAILED);
831831
}
832-
#endif // NDEBUG
832+
#endif // !defined(NDEBUG) && !defined(GTEST_PSEUDO_WINDOWS)
833833
#endif
834834

835835
TEST_F(CryptoModulesTest, RangeParserSuccess)

aws-cpp-sdk-s3-encryption/CMakeLists.txt

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
add_project(aws-cpp-sdk-s3-encryption-integration-tests
1+
add_project(aws-cpp-sdk-s3-encryption
22
"Amazon S3 Encryption Client"
3-
aws-cpp-sdk-core
4-
aws-cpp-sdk-s3
3+
aws-cpp-sdk-core
4+
aws-cpp-sdk-s3
55
aws-cpp-sdk-kms)
66

77
file( GLOB S3ENCRYPTION_HEADERS "include/aws/s3-encryption/*.h" )
@@ -55,30 +55,23 @@ set(S3ENCRYPTION_INCLUDES
5555

5656
include_directories(${S3ENCRYPTION_INCLUDES})
5757

58-
if(MSVC AND BUILD_SHARED_LIBS)
58+
if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS)
5959
add_definitions("-DAWS_S3ENCRYPTION_EXPORTS")
6060
endif()
6161

62-
add_library(aws-cpp-sdk-s3-encryption ${LIBTYPE} ${ALL_S3ENCRYPTION})
62+
add_library(${PROJECT_NAME} ${LIBTYPE} ${ALL_S3ENCRYPTION})
63+
add_library(AWS::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
6364

64-
target_include_directories(aws-cpp-sdk-s3-encryption PUBLIC
65+
target_include_directories(${PROJECT_NAME} PUBLIC
6566
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
6667
$<INSTALL_INTERFACE:include>)
67-
target_link_libraries(aws-cpp-sdk-s3-encryption ${PROJECT_LIBS})
68+
target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS})
6869

69-
if(SIMPLE_INSTALL)
70-
install (TARGETS aws-cpp-sdk-s3-encryption
71-
ARCHIVE DESTINATION ${ARCHIVE_DIRECTORY}
72-
LIBRARY DESTINATION lib
73-
RUNTIME DESTINATION bin)
74-
else()
75-
install (TARGETS aws-cpp-sdk-s3-encryption
76-
ARCHIVE DESTINATION ${ARCHIVE_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
77-
LIBRARY DESTINATION lib/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
78-
RUNTIME DESTINATION bin/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME})
79-
endif()
70+
setup_install()
8071

8172
install (FILES ${S3ENCRYPTION_HEADERS} DESTINATION include/aws/s3-encryption)
8273
install (FILES ${S3ENCRYPTION_MATERIALS_HEADERS} DESTINATION include/aws/s3-encryption/materials)
8374
install (FILES ${S3ENCRYPTION_HANDLERS_HEADERS} DESTINATION include/aws/s3-encryption/handlers)
8475
install (FILES ${S3ENCRYPTION_MODULES_HEADERS} DESTINATION include/aws/s3-encryption/modules)
76+
77+
do_packaging()

aws-cpp-sdk-s3-encryption/include/aws/s3-encryption/s3Encryption_EXPORTS.h

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@
1212
* express or implied. See the License for the specific language governing
1313
* permissions and limitations under the License.
1414
*/
15+
1516
#pragma once
1617

17-
#ifdef _WIN32
18-
//disable windows complaining about max template size.
19-
#pragma warning (disable : 4503)
20-
#endif
18+
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
19+
#ifdef _MSC_VER
20+
#pragma warning(disable : 4251)
21+
#endif // _MSC_VER
22+
#ifdef USE_IMPORT_EXPORT
23+
#ifdef AWS_S3ENCRYPTION_EXPORTS
24+
#define AWS_S3ENCRYPTION_API __declspec(dllexport)
25+
#else // AWS_S3ENCRYPTION_EXPORTS
26+
#define AWS_S3ENCRYPTION_API __declspec(dllimport)
27+
#endif // AWS_S3ENCRYPTION_EXPORTS
28+
#else // USE_IMPORT_EXPORT
29+
#define AWS_S3ENCRYPTION_API
30+
#endif // USE_IMPORT_EXPORT
31+
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
32+
#define AWS_S3ENCRYPTION_API
33+
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
2134

22-
#if defined (_MSC_VER)
23-
#pragma warning(disable : 4251)
24-
#ifdef USE_IMPORT_EXPORT
25-
#ifdef AWS_S3ENCRYPTION_EXPORTS
26-
#define AWS_S3ENCRYPTION_API __declspec(dllexport)
27-
#else
28-
#define AWS_S3ENCRYPTION_API __declspec(dllimport)
29-
#endif /* AWS_S3ENCRYPTION_EXPORTS */
30-
#else
31-
#define AWS_S3ENCRYPTION_API
32-
#endif //
33-
#else /* defined (_WIN32) */
34-
#define AWS_S3ENCRYPTION_API
35-
#endif

cmake/build_external.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ if(BUILD_CURL OR BUILD_OPENSSL OR BUILD_ZLIB)
5555

5656
# OpenSSL
5757
if(BUILD_OPENSSL)
58-
set(OPENSSL_SOURCE_DIR ${CMAKE_BINARY_DIR}/openssl CACHE INTERNAL "openssl source dir")
58+
set(OPENSSL_SOURCE_DIR ${CMAKE_BINARY_DIR}/openssl-src CACHE INTERNAL "openssl source dir")
5959
set(OPENSSL_INSTALL_DIR ${EXTERNAL_INSTALL_DIR}/openssl CACHE INTERNAL "openssl install dir")
6060
set(OPENSSL_INCLUDE_DIR ${OPENSSL_INSTALL_DIR}/include CACHE INTERNAL "openssl include dir")
6161
set(OPENSSL_LIBRARY_DIR ${OPENSSL_INSTALL_DIR}/lib CACHE INTERNAL "openssl library dir")
6262
set(OPENSSL_CXX_FLAGS "${EXTERNAL_CXX_FLAGS} ${ZLIB_INCLUDE_FLAGS} -fPIE" CACHE INTERNAL "openssl")
6363
set(OPENSSL_C_FLAGS "${EXTERNAL_C_FLAGS} ${ZLIB_INCLUDE_FLAGS} -fPIE" CACHE INTERNAL "openssl")
64+
if(ANDROID_ABI STREQUAL "x86_64")
65+
set(OPENSSL_C_FLAGS "${OPENSSL_C_FLAGS} -DOPENSSL_NO_INLINE_ASM" CACHE INTERNAL "openssl")
66+
endif()
6467
set(OPENSSL_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie" CACHE INTERNAL "openssl")
6568

6669
set(OPENSSL_INCLUDE_FLAGS "-isystem ${OPENSSL_INCLUDE_DIR} -isystem ${OPENSSL_INCLUDE_DIR}/openssl" CACHE INTERNAL "compiler flags to find openssl includes")

0 commit comments

Comments
 (0)