Skip to content

Commit 16948cd

Browse files
committed
Partial implementation of build for core-test
Build fails from mixed use of types from CRT and SDK that was fixed after the creation of this branch. The rebase is going to be huge, so breaking the push in 2 steps befor continuing.
1 parent e5cf806 commit 16948cd

File tree

7 files changed

+35
-44
lines changed

7 files changed

+35
-44
lines changed

CMakeLists.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,7 @@ else ()
9595
endif ()
9696

9797
# -- Dependencies --
98-
add_subdirectory(dependencies)
99-
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
100-
# Testing Dependencies
101-
if (BUILD_TESTING)
102-
message(STATUS "Building tests")
103-
# Testing dependency
104-
find_package(GTest 1.11 REQUIRED)
105-
include(GoogleTest) # for gtest_discover_tests()
106-
endif ()
107-
endif ()
98+
include(dependencies)
10899

109100
# -- main build targets --
110101
add_subdirectory(src)
@@ -121,9 +112,6 @@ else ()
121112

122113
message(WARNING "Anything below this warning is a TODO not yet implemented.")
123114

124-
message(STATUS "Setting up core library.")
125-
message(STATUS "Prepare CRT dependency.")
126-
message(STATUS "Building core library.")
127115
message(STATUS "Building core library tests.")
128116
message(STATUS "Add support for static analysis.")
129117
message(STATUS "Building client libraries.")

cmake/Findaws-crt-cpp.cmake

Lines changed: 0 additions & 12 deletions
This file was deleted.

cmake/dependencies.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Project dependencies http library (curl or OS), tinyxml2, cJSON, ssl (open or other), CRT
2+
find_package(CURL REQUIRED)
3+
find_package(ZLIB REQUIRED)
4+
find_package(OpenSSL REQUIRED COMPONENTS Crypto)
5+
pkg_check_modules(tinyxml2 REQUIRED IMPORTED_TARGET tinyxml2>=9.0.0)
6+
pkg_check_modules(CJSON REQUIRED IMPORTED_TARGET libcjson>=1.7.15)
7+
message(STATUS "Checking for aws-crt-cpp version 0.18.2")
8+
find_package(aws-crt-cpp 0.18.2 EXACT REQUIRED)
9+
message(STATUS " Found aws-crt-cpp version ${aws-crt-cpp_VERSION}")
10+
# Infer dirs and libs temporarily from aws-crt-cpp_DIR until they get shipped in the new CRT version.
11+
set(aws-crt-cpp_INCLUDE_DIR "${aws-crt-cpp_DIR}/../../../include")
12+
set(aws-crt-cpp_INCLUDE_DIRS "${aws-crt-cpp_DIR}/../../../include")
13+
set(aws-crt-cpp_LIBRARY_DIRS "${aws-crt-cpp_DIR}/../..")
14+
set(aws-crt-cpp_LIBRARIES aws-crt-cpp aws-c-common aws-c-event-stream aws-c-mqtt aws-c-s3 aws-c-auth aws-c-sdkutils aws-c-http aws-c-compression aws-c-io s2n aws-checksums aws-c-common aws-c-cal)
15+
set(aws-crt-cpp_LIBRARY_DIRS "${aws-crt-cpp_DIR}/..")
16+
17+
if (BUILD_TESTING)
18+
message(STATUS "Building tests")
19+
# Testing dependency
20+
find_package(GTest 1.11 REQUIRED)
21+
include(GoogleTest) # for gtest_discover_tests()
22+
endif ()

dependencies/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/aws-cpp-sdk-core-tests/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ if (NOT LEGACY_BUILD)
77
)
88
add_subdirectory(testing-resources)
99

10-
add_executable(
11-
aws-core-version
12-
${CMAKE_CURRENT_LIST_DIR}/VersionTests.cpp
13-
${CMAKE_CURRENT_LIST_DIR}/RunTests.cpp
14-
)
10+
add_executable(aws_core_test)
1511
target_link_libraries(
16-
aws-core-version
12+
aws_core_test
1713
PRIVATE GTest::GTest
1814
PRIVATE aws-sdk-cpp::core
1915
PRIVATE aws-sdk-cpp::test-resources
2016
)
17+
target_sources(aws_core_test
18+
PRIVATE
19+
${CMAKE_CURRENT_SOURCE_DIR}/RunTests.cpp
20+
${CMAKE_CURRENT_SOURCE_DIR}/VersionTests.cpp
21+
)
22+
gtest_discover_tests(aws_core_test)
2123

22-
# add_subdirectory(monitoring)
23-
message(WARNING "Not testing everything yet...")
24+
message(WARNING "Building core test with new cmake scripts not yet implemented")
2425
else ()
2526
add_project(aws-cpp-sdk-core-tests
2627
"Tests for the AWS Core C++ Library"
@@ -145,4 +146,4 @@ else ()
145146
if (NOT CMAKE_CROSSCOMPILING)
146147
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
147148
endif ()
148-
endif ()
149+
endif ()

src/aws-cpp-sdk-core/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ if (NOT LEGACY_BUILD)
1010
)
1111
target_link_directories(
1212
aws-sdk-cpp-core
13-
PUBLIC ${aws-crt-cpp_LIB_DIRS}
13+
PUBLIC ${aws-crt-cpp_LIBRARY_DIRS}
1414
PUBLIC ${CJSON_LIBRARY_DIRS}
1515
PUBLIC ${tinyxml2_LIBRARY_DIRS}
1616
)
1717
target_link_libraries(
1818
aws-sdk-cpp-core
19-
aws-crt-cpp aws-c-common aws-checksums
19+
${aws-crt-cpp_LIBRARIES}
2020
${CJSON_LIBRARIES}
2121
${tinyxml2_LIBRARIES}
2222
)

src/aws-cpp-sdk-core/source/utils/crypto/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
message(WARNING "not complete implementation yet")
21
if (USE_OPENSSL)
32
add_subdirectory(openssl)
43
endif ()

0 commit comments

Comments
 (0)