Skip to content

Commit b9a2259

Browse files
committed
Preparing toolchain and dependencies
1 parent b06b085 commit b9a2259

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

CMakeLists.txt

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ else ()
4040
set(CMAKE_CXX_EXTENSIONS OFF)
4141
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4242

43-
message(STATUS "Building ${PROJECT_NAME} ${CMAKE_PROJECT_VERSION}")
43+
# Setting build to hide symbols in targets by default
44+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
45+
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
4446

45-
# Setting version header for library
47+
# Preventing writes to package registry by default
48+
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY YES)
49+
50+
message(STATUS "Generating source file for introspection of version to ${CMAKE_PROJECT_VERSION} ")
4651
configure_file(
4752
VersionConfig.h.in
4853
src/aws-cpp-sdk-core/include/aws/core/VersionConfig.h
@@ -62,10 +67,31 @@ else ()
6267
message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}")
6368
endif ()
6469
endif ()
65-
option(BUILD_TESTS "If enabled, the SDK will include tests in the build" OFF)
70+
71+
# Options definition
72+
option(BUILD_TESTING "If enabled, the SDK will include tests in the build" OFF)
73+
74+
message(STATUS "Setting toolchain and dependencies")
75+
if (BUILD_TESTING)
76+
message(STATUS "Building tests")
77+
enable_testing()
78+
# Testing dependency
79+
find_package(GTest 1.11 REQUIRED )
80+
include(GoogleTest) # for gtest_discover_tests()
81+
endif ()
82+
83+
# Project dependencies http library (curl or OS), tinyxml2, cJSON, ssl (open or other), CRT
84+
find_package(CURL REQUIRED)
85+
find_package(ZLIB REQUIRED)
86+
find_package(OpenSSL REQUIRED COMPONENTS Crypto)
87+
pkg_check_modules(tinyxml2 REQUIRED IMPORTED_TARGET tinyxml2>=9.0.0)
88+
pkg_check_modules(CJSON REQUIRED IMPORTED_TARGET libcjson>=1.7.15)
89+
find_package(aws-crt-cpp 0.17.9 EXACT REQUIRED COMPONENTS io)
90+
91+
message(WARNING "The dependencies are currently checked only for a basic Linux build, new ones need to be added for other platforms yet")
6692

6793
message(WARNING "Anything below this warning is a TODO not yet implemented.")
68-
message(STATUS "Detecting toolchain and external dependencies.")
94+
6995
message(STATUS "Setting up core library.")
7096
message(STATUS "Prepare CRT dependency.")
7197
message(STATUS "Building core library.")

cmake/Findaws-crt-cpp.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This is a temporary mock file to be able to test our current build setup.
2+
# The file will later be read from CRTpp installation
3+
message(WARNING "AWSCRTpp is mocked for testing of experimental feature branch. Remove this file when CRT starts providing it.")

0 commit comments

Comments
 (0)