-
Notifications
You must be signed in to change notification settings - Fork 1.1k
build dev 1.10 pr8 #1935
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
build dev 1.10 pr8 #1935
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,9 +40,14 @@ else () | |
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
message(STATUS "Building ${PROJECT_NAME} ${CMAKE_PROJECT_VERSION}") | ||
# Setting build to hide symbols in targets by default | ||
set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES) | ||
|
||
# Setting version header for library | ||
# Preventing writes to package registry by default | ||
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY YES) | ||
|
||
message(STATUS "Generating source file for introspection of version to ${CMAKE_PROJECT_VERSION} ") | ||
configure_file( | ||
VersionConfig.h.in | ||
src/aws-cpp-sdk-core/include/aws/core/VersionConfig.h | ||
|
@@ -62,10 +67,31 @@ else () | |
message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}") | ||
endif () | ||
endif () | ||
option(BUILD_TESTS "If enabled, the SDK will include tests in the build" OFF) | ||
|
||
# Options definition | ||
option(BUILD_TESTING "If enabled, the SDK will include tests in the build" OFF) | ||
|
||
message(STATUS "Setting toolchain and dependencies") | ||
if (BUILD_TESTING) | ||
message(STATUS "Building tests") | ||
enable_testing() | ||
# Testing dependency | ||
find_package(GTest 1.11 REQUIRED ) | ||
include(GoogleTest) # for gtest_discover_tests() | ||
endif () | ||
|
||
# Project dependencies http library (curl or OS), tinyxml2, cJSON, ssl (open or other), CRT | ||
find_package(CURL REQUIRED) | ||
find_package(ZLIB REQUIRED) | ||
find_package(OpenSSL REQUIRED COMPONENTS Crypto) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about aws-lc and s2n? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment below, this is a "basic Linux" build to start exploring full build, more dependencies will be added for support more platforms along the path before this branch is merged we want parity with what we supported before. |
||
pkg_check_modules(tinyxml2 REQUIRED IMPORTED_TARGET tinyxml2>=9.0.0) | ||
pkg_check_modules(CJSON REQUIRED IMPORTED_TARGET libcjson>=1.7.15) | ||
find_package(aws-crt-cpp 0.17.9 EXACT REQUIRED COMPONENTS io) | ||
|
||
message(WARNING "The dependencies are currently checked only for a basic Linux build, new ones need to be added for other platforms yet") | ||
|
||
message(WARNING "Anything below this warning is a TODO not yet implemented.") | ||
message(STATUS "Detecting toolchain and external dependencies.") | ||
|
||
message(STATUS "Setting up core library.") | ||
message(STATUS "Prepare CRT dependency.") | ||
message(STATUS "Building core library.") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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.") |
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.
will it also hide all C-symbols not marked as static from C translation units?
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.
It seems like this only affected C++ until version 3.12 of CMAKE, not applies also to C.
https://cmake.org/cmake/help/latest/module/GenerateExportHeader.html?highlight=cmake_cxx_visibility_preset
I will leave it like this for now, we shouldn't expose anything C at this SDK right now, but worth to dig into this further for future use cases.