-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Setting up core library build logic branch and cpack for Archives #1948
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# This is a temporary mock file to be able to test our current build setup. | ||
# The file will later be read from CRTpp installation | ||
message(WARNING "AWSCRTpp is mocked for testing of experimental feature branch. Remove this file when CRT starts providing it.") | ||
message(WARNING "aws-crt-cpp package is mocked for testing of experimental feature branch. Remove this file when CRT starts providing it.") |
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,23 @@ | ||
if (WIN32) #Starting simple with archive only packages | ||
set(CPACK_GENERATOR ZIP) | ||
else () | ||
set(CPACK_GENERATOR TGZ) | ||
endif () | ||
|
||
set(CPACK_PACKAGE_NAME "aws-cpp-sdk") | ||
set(CPACK_PACKAGE_VENDOR "Amazon Web Services") | ||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) | ||
set(CPACK_PACKAGE_VERSION_MAJOR ${aws-cpp-sdk_VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${aws-cpp-sdk_VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${aws-cpp-sdk_VERSION_PATCH}) | ||
set(CPACK_VERBATIM_VARIABLES YES) | ||
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_LIST_DIR}/../LICENSE) | ||
set(CPACK_RESOURCE_FILE_README${CMAKE_CURRENT_LIST_DIR}/../Readme.md) | ||
set(CPACK_MONOLITHIC_INSTALL OFF) | ||
set(CPACK_COMPONENTS_GROUPING IGNORE) | ||
include(CPack) | ||
cpack_add_component(aws-cpp-sdk_core | ||
DISPLAY_NAME Core | ||
DESCRIPTION "Core library" | ||
REQUIRED | ||
) |
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 @@ | ||
add_subdirectory(aws-cpp-sdk-core) | ||
if (BUILD_TESTING) | ||
add_subdirectory(aws-cpp-sdk-core-tests) | ||
endif () |
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 |
---|---|---|
@@ -1,123 +1,127 @@ | ||
add_project(aws-cpp-sdk-core-tests | ||
"Tests for the AWS Core C++ Library" | ||
testing-resources | ||
aws-cpp-sdk-core ) | ||
|
||
# Headers are included in the source so that they show up in Visual Studio. | ||
# They are included elsewhere for consistency. | ||
file(GLOB AWS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/*.cpp") | ||
file(GLOB AWS_AUTH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/auth/*.cpp") | ||
file(GLOB AWS_CONFIG_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/config/*.cpp") | ||
file(GLOB AWS_CLIENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/client/*.cpp") | ||
file(GLOB AWS_NET_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/net/*.cpp") | ||
file(GLOB HTTP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/http/*.cpp") | ||
file(GLOB UTILS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.cpp") | ||
file(GLOB UTILS_CRYPTO_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/crypto/*.cpp") | ||
file(GLOB UTILS_EVENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/event/*.cpp") | ||
file(GLOB UTILS_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/json/*.cpp") | ||
file(GLOB UTILS_STREAM_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/stream/*.cpp") | ||
file(GLOB UTILS_LOGGING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/logging/*.cpp") | ||
file(GLOB UTILS_RATE_LIMITER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/ratelimiter/*.cpp") | ||
file(GLOB UTILS_XML_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/xml/*.cpp") | ||
file(GLOB UTILS_THREADING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/threading/*.cpp") | ||
file(GLOB UTILS_MEMORY_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/memory/*.cpp") | ||
file(GLOB MONITORING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/monitoring/*.cpp") | ||
|
||
|
||
file(GLOB AWS_CPP_SDK_CORE_TESTS_SRC | ||
"${CMAKE_CURRENT_SOURCE_DIR}/RunTests.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/VersionTests.cpp" | ||
${AWS_SRC} | ||
${AWS_AUTH_SRC} | ||
${AWS_CONFIG_SRC} | ||
${MONITORING_SRC} | ||
${AWS_CLIENT_SRC} | ||
${AWS_NET_SRC} | ||
${HTTP_SRC} | ||
${UTILS_SRC} | ||
${UTILS_CRYPTO_SRC} | ||
${UTILS_EVENT_SRC} | ||
${UTILS_JSON_SRC} | ||
${UTILS_STREAM_SRC} | ||
${UTILS_XML_SRC} | ||
${UTILS_THREADING_SRC} | ||
${UTILS_MEMORY_SRC} | ||
${UTILS_LOGGING_SRC} | ||
${UTILS_RATE_LIMITER_SRC} | ||
) | ||
|
||
if(PLATFORM_WINDOWS) | ||
if(MSVC) | ||
source_group("Source Files\\aws" FILES ${AWS_SRC}) | ||
source_group("Source Files\\aws\\auth" FILES ${AWS_AUTH_SRC}) | ||
source_group("Source Files\\aws\\config" FILES ${AWS_CONFIG_SRC}) | ||
source_group("Source Files\\aws\\client" FILES ${AWS_CLIENT_SRC}) | ||
source_group("Source Files\\aws\\net" FILES ${AWS_NET_SRC}) | ||
source_group("Source Files\\http" FILES ${HTTP_SRC}) | ||
source_group("Source Files\\monitoring" FILES ${MONITORING_SRC}) | ||
source_group("Source Files\\utils" FILES ${UTILS_SRC}) | ||
source_group("Source Files\\utils\\crypto" FILES ${UTILS_CRYPTO_SRC}) | ||
source_group("Source Files\\utils\\event" FILES ${UTILS_EVENT_SRC}) | ||
source_group("Source Files\\utils\\json" FILES ${UTILS_JSON_SRC}) | ||
source_group("Source Files\\utils\\stream" FILES ${UTILS_STREAM_SRC}) | ||
source_group("Source Files\\utils\\xml" FILES ${UTILS_XML_SRC}) | ||
source_group("Source Files\\utils\\logging" FILES ${UTILS_LOGGING_SRC}) | ||
source_group("Source Files\\utils\\ratelimiter" FILES ${UTILS_RATE_LIMITER_SRC}) | ||
source_group("Source Files\\utils\\memory" FILES ${UTILS_MEMORY_SRC}) | ||
source_group("Source Files\\utils\\threading" FILES ${UTILS_THREADING_SRC}) | ||
endif() | ||
endif() | ||
|
||
if(PLATFORM_CUSTOM) | ||
if(COMMAND add_custom_core_testing_definitions) | ||
add_custom_core_testing_definitions() | ||
endif() | ||
endif() | ||
|
||
if (CMAKE_CROSSCOMPILING) | ||
set(AUTORUN_UNIT_TESTS OFF) | ||
endif() | ||
|
||
if (AUTORUN_UNIT_TESTS) | ||
enable_testing() | ||
endif() | ||
|
||
if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS) | ||
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1) | ||
endif() | ||
|
||
if(PLATFORM_ANDROID AND BUILD_SHARED_LIBS) | ||
add_library(${PROJECT_NAME} ${AWS_CPP_SDK_CORE_TESTS_SRC}) | ||
else() | ||
add_executable(${PROJECT_NAME} ${AWS_CPP_SDK_CORE_TESTS_SRC}) | ||
endif() | ||
|
||
set_compiler_flags(${PROJECT_NAME}) | ||
set_compiler_warnings(${PROJECT_NAME}) | ||
|
||
if (NO_HTTP_CLIENT) | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE "NO_HTTP_CLIENT") | ||
endif() | ||
|
||
target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS} ${CLIENT_LIBS}) | ||
|
||
if(ENABLE_FUNCTIONAL_TESTING) | ||
target_link_libraries(${PROJECT_NAME} aws-cpp-sdk-document-test) | ||
endif() | ||
|
||
add_custom_command(TARGET aws-cpp-sdk-core-tests PRE_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
${CMAKE_CURRENT_SOURCE_DIR}/resources ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
if (ENABLE_HTTP_CLIENT_TESTING) | ||
add_definitions(-DENABLE_HTTP_CLIENT_TESTING) | ||
endif() | ||
|
||
if (AUTORUN_UNIT_TESTS) | ||
ADD_CUSTOM_COMMAND( TARGET ${PROJECT_NAME} POST_BUILD COMMAND $<TARGET_FILE:${PROJECT_NAME}> | ||
ARGS "--gtest_shuffle" "--gtest_repeat=3") | ||
endif() | ||
|
||
if(NOT CMAKE_CROSSCOMPILING) | ||
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) | ||
endif() | ||
if (NOT LEGACY_BUILD) | ||
message(WARNING "Building core with new cmake scripts not yet implemented") | ||
else () | ||
add_project(aws-cpp-sdk-core-tests | ||
"Tests for the AWS Core C++ Library" | ||
testing-resources | ||
aws-cpp-sdk-core) | ||
|
||
# Headers are included in the source so that they show up in Visual Studio. | ||
# They are included elsewhere for consistency. | ||
file(GLOB AWS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/*.cpp") | ||
file(GLOB AWS_AUTH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/auth/*.cpp") | ||
file(GLOB AWS_CONFIG_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/config/*.cpp") | ||
file(GLOB AWS_CLIENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/client/*.cpp") | ||
file(GLOB AWS_NET_SRC "${CMAKE_CURRENT_SOURCE_DIR}/aws/net/*.cpp") | ||
file(GLOB HTTP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/http/*.cpp") | ||
file(GLOB UTILS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.cpp") | ||
file(GLOB UTILS_CRYPTO_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/crypto/*.cpp") | ||
file(GLOB UTILS_EVENT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/event/*.cpp") | ||
file(GLOB UTILS_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/json/*.cpp") | ||
file(GLOB UTILS_STREAM_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/stream/*.cpp") | ||
file(GLOB UTILS_LOGGING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/logging/*.cpp") | ||
file(GLOB UTILS_RATE_LIMITER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/ratelimiter/*.cpp") | ||
file(GLOB UTILS_XML_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/xml/*.cpp") | ||
file(GLOB UTILS_THREADING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/threading/*.cpp") | ||
file(GLOB UTILS_MEMORY_SRC "${CMAKE_CURRENT_SOURCE_DIR}/utils/memory/*.cpp") | ||
file(GLOB MONITORING_SRC "${CMAKE_CURRENT_SOURCE_DIR}/monitoring/*.cpp") | ||
|
||
|
||
file(GLOB AWS_CPP_SDK_CORE_TESTS_SRC | ||
"${CMAKE_CURRENT_SOURCE_DIR}/RunTests.cpp" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/VersionTests.cpp" | ||
${AWS_SRC} | ||
${AWS_AUTH_SRC} | ||
${AWS_CONFIG_SRC} | ||
${MONITORING_SRC} | ||
${AWS_CLIENT_SRC} | ||
${AWS_NET_SRC} | ||
${HTTP_SRC} | ||
${UTILS_SRC} | ||
${UTILS_CRYPTO_SRC} | ||
${UTILS_EVENT_SRC} | ||
${UTILS_JSON_SRC} | ||
${UTILS_STREAM_SRC} | ||
${UTILS_XML_SRC} | ||
${UTILS_THREADING_SRC} | ||
${UTILS_MEMORY_SRC} | ||
${UTILS_LOGGING_SRC} | ||
${UTILS_RATE_LIMITER_SRC} | ||
) | ||
|
||
if (PLATFORM_WINDOWS) | ||
if (MSVC) | ||
source_group("Source Files\\aws" FILES ${AWS_SRC}) | ||
source_group("Source Files\\aws\\auth" FILES ${AWS_AUTH_SRC}) | ||
source_group("Source Files\\aws\\config" FILES ${AWS_CONFIG_SRC}) | ||
source_group("Source Files\\aws\\client" FILES ${AWS_CLIENT_SRC}) | ||
source_group("Source Files\\aws\\net" FILES ${AWS_NET_SRC}) | ||
source_group("Source Files\\http" FILES ${HTTP_SRC}) | ||
source_group("Source Files\\monitoring" FILES ${MONITORING_SRC}) | ||
source_group("Source Files\\utils" FILES ${UTILS_SRC}) | ||
source_group("Source Files\\utils\\crypto" FILES ${UTILS_CRYPTO_SRC}) | ||
source_group("Source Files\\utils\\event" FILES ${UTILS_EVENT_SRC}) | ||
source_group("Source Files\\utils\\json" FILES ${UTILS_JSON_SRC}) | ||
source_group("Source Files\\utils\\stream" FILES ${UTILS_STREAM_SRC}) | ||
source_group("Source Files\\utils\\xml" FILES ${UTILS_XML_SRC}) | ||
source_group("Source Files\\utils\\logging" FILES ${UTILS_LOGGING_SRC}) | ||
source_group("Source Files\\utils\\ratelimiter" FILES ${UTILS_RATE_LIMITER_SRC}) | ||
source_group("Source Files\\utils\\memory" FILES ${UTILS_MEMORY_SRC}) | ||
source_group("Source Files\\utils\\threading" FILES ${UTILS_THREADING_SRC}) | ||
endif () | ||
endif () | ||
|
||
if (PLATFORM_CUSTOM) | ||
if (COMMAND add_custom_core_testing_definitions) | ||
add_custom_core_testing_definitions() | ||
endif () | ||
endif () | ||
|
||
if (CMAKE_CROSSCOMPILING) | ||
set(AUTORUN_UNIT_TESTS OFF) | ||
endif () | ||
|
||
if (AUTORUN_UNIT_TESTS) | ||
enable_testing() | ||
endif () | ||
|
||
if (USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS) | ||
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1) | ||
endif () | ||
|
||
if (PLATFORM_ANDROID AND BUILD_SHARED_LIBS) | ||
add_library(${PROJECT_NAME} ${AWS_CPP_SDK_CORE_TESTS_SRC}) | ||
else () | ||
add_executable(${PROJECT_NAME} ${AWS_CPP_SDK_CORE_TESTS_SRC}) | ||
endif () | ||
|
||
set_compiler_flags(${PROJECT_NAME}) | ||
set_compiler_warnings(${PROJECT_NAME}) | ||
|
||
if (NO_HTTP_CLIENT) | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE "NO_HTTP_CLIENT") | ||
endif () | ||
|
||
target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS} ${CLIENT_LIBS}) | ||
|
||
if (ENABLE_FUNCTIONAL_TESTING) | ||
target_link_libraries(${PROJECT_NAME} aws-cpp-sdk-document-test) | ||
endif () | ||
|
||
add_custom_command(TARGET aws-cpp-sdk-core-tests PRE_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
${CMAKE_CURRENT_SOURCE_DIR}/resources ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
if (ENABLE_HTTP_CLIENT_TESTING) | ||
add_definitions(-DENABLE_HTTP_CLIENT_TESTING) | ||
endif () | ||
|
||
if (AUTORUN_UNIT_TESTS) | ||
ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD COMMAND $<TARGET_FILE:${PROJECT_NAME}> | ||
ARGS "--gtest_shuffle" "--gtest_repeat=3") | ||
endif () | ||
|
||
if (NOT CMAKE_CROSSCOMPILING) | ||
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) | ||
endif () | ||
endif () |
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.
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.
could we use a generator expression here? (docs)
i.e.