Skip to content

Commit 8fa6c2a

Browse files
authored
Update dependencies (aws#24)
Using latest tagged version of all dependencies.
1 parent 792a4b8 commit 8fa6c2a

18 files changed

+111
-57
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set(AWS_CRT_CPP_VERSION "v0.3.0")
2020
configure_file(include/aws/crt/Config.h.in ${CMAKE_CURRENT_LIST_DIR}/include/aws/crt/Config.h @ONLY)
2121

2222
if (BUILD_DEPS)
23-
set(AWS_DEPS_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps)
23+
set(AWS_DEPS_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps CACHE STRING "If BUILD_DEPS is on, aws common runtime dependencies build in this directory.")
2424
if (DEFINED CMAKE_INSTALL_PREFIX)
2525
set(AWS_DEPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
2626
else()
@@ -136,7 +136,7 @@ file(GLOB AWS_CRT_CPP_HEADERS
136136
${AWS_CRT_EXTERNAL_HEADERS}
137137
)
138138

139-
file(GLOB AWS_CRT_SRC
139+
file(GLOB AWS_CRT_SRC
140140
"source/*.cpp"
141141
)
142142

@@ -208,7 +208,7 @@ aws_prepare_symbol_visibility_args(${CMAKE_PROJECT_NAME} "AWS_CRT_CPP")
208208

209209
#set warnings
210210
if (MSVC)
211-
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /W4 /WX)
211+
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /W4 /WX /wd4068)
212212
else ()
213213
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic -Werror)
214214
endif ()

aws-common-runtime/CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set(AWS_DEPS_DOWNLOAD_DIR "${AWS_DEPS_BUILD_DIR}/downloads" CACHE PATH "Dependen
1717

1818
message("install dir ${AWS_DEPS_INSTALL_DIR}")
1919
set(AWS_C_COMMON_URL "https://github.com/awslabs/aws-c-common.git")
20-
set(AWS_C_COMMON_SHA "v0.3.6")
20+
set(AWS_C_COMMON_SHA "v0.3.11")
2121
include(BuildAwsCCommon)
2222

2323
if (UNIX AND NOT APPLE)
@@ -27,23 +27,28 @@ if (UNIX AND NOT APPLE)
2727
endif()
2828

2929
set(AWS_C_IO_URL "https://github.com/awslabs/aws-c-io.git")
30-
set(AWS_C_IO_SHA "v0.3.0")
30+
set(AWS_C_IO_SHA "v0.3.9")
3131
include(BuildAwsCIO)
3232

33+
set(AWS_C_COMPRESSION_URL "https://github.com/awslabs/aws-c-compression.git")
34+
set(AWS_C_COMPRESSION_SHA "v0.2.1")
35+
include(BuildAwsCCompression)
36+
3337
set(AWS_C_HTTP_URL "https://github.com/awslabs/aws-c-http.git")
34-
set(AWS_C_HTTP_SHA "v0.2.2")
38+
set(AWS_C_HTTP_SHA "v0.2.16")
3539
include(BuildAwsCHttp)
3640

3741
set(AWS_C_MQTT_URL "https://github.com/awslabs/aws-c-mqtt.git")
38-
set(AWS_C_MQTT_SHA "v0.3.5")
42+
set(AWS_C_MQTT_SHA "v0.3.7")
3943
include(BuildAwsCMqtt)
4044

4145
set(AWS_C_CAL_URL "https://github.com/awslabs/aws-c-cal.git")
42-
set(AWS_C_CAL_SHA "v0.1.4")
46+
set(AWS_C_CAL_SHA "v0.1.5")
4347
include(BuildAwsCCal)
4448

49+
add_dependencies(AwsCCompression AwsCCommon)
4550
add_dependencies(AwsCMqtt AwsCIO)
46-
add_dependencies(AwsCHttp AwsCIO)
51+
add_dependencies(AwsCHttp AwsCIO AwsCCompression)
4752
add_dependencies(AwsCCal AwsCCommon)
4853

4954
if (UNIX AND NOT APPLE)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
if("${TARGET_ARCH}" STREQUAL ANDROID)
2+
ExternalProject_Add(AwsCCompression
3+
PREFIX ${AWS_DEPS_BUILD_DIR}
4+
GIT_REPOSITORY ${AWS_C_COMPRESSION_URL}
5+
GIT_TAG ${AWS_C_COMPRESSION_SHA}
6+
BUILD_IN_SOURCE 0
7+
UPDATE_COMMAND ""
8+
CMAKE_ARGS
9+
-DCMAKE_INSTALL_PREFIX=${AWS_DEPS_INSTALL_DIR}
10+
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
11+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
12+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
13+
-DANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL}
14+
-DANDROID_ABI=${ANDROID_ABI}
15+
-DANDROID_TOOLCHAIN_NAME=${ANDROID_TOOLCHAIN_NAME}
16+
-DANDROID_STANDALONE_TOOLCHAIN=${ANDROID_STANDALONE_TOOLCHAIN}
17+
-DANDROID_STL=${ANDROID_STL}
18+
-DENABLE_HW_OPTIMIZATION=OFF
19+
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
20+
)
21+
elseif(MSVC)
22+
ExternalProject_Add(AwsCCompression
23+
PREFIX ${AWS_DEPS_BUILD_DIR}
24+
GIT_REPOSITORY ${AWS_C_COMPRESSION_URL}
25+
GIT_TAG ${AWS_C_COMPRESSION_SHA}
26+
BUILD_IN_SOURCE 0
27+
UPDATE_COMMAND ""
28+
CMAKE_ARGS
29+
-DCMAKE_INSTALL_PREFIX=${AWS_DEPS_INSTALL_DIR}
30+
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
31+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
32+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
33+
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
34+
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
35+
)
36+
else()
37+
ExternalProject_Add(AwsCCompression
38+
PREFIX ${AWS_DEPS_BUILD_DIR}
39+
GIT_REPOSITORY ${AWS_C_COMPRESSION_URL}
40+
GIT_TAG ${AWS_C_COMPRESSION_SHA}
41+
BUILD_IN_SOURCE 0
42+
UPDATE_COMMAND ""
43+
CMAKE_ARGS
44+
-DCMAKE_INSTALL_PREFIX=${AWS_DEPS_INSTALL_DIR}
45+
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
46+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
47+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
48+
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
49+
)
50+
endif()

aws-common-runtime/cmake/BuildAwsCHttp.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
66
BUILD_IN_SOURCE 0
77
UPDATE_COMMAND ""
88
CMAKE_ARGS
9-
-DCMAKE_PREFIX_PATH=${AWS_DEPS_INSTALL_DIR}
109
-DCMAKE_INSTALL_PREFIX=${AWS_DEPS_INSTALL_DIR}
1110
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
1211
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@@ -28,7 +27,6 @@ elseif(MSVC)
2827
BUILD_IN_SOURCE 0
2928
UPDATE_COMMAND ""
3029
CMAKE_ARGS
31-
-DCMAKE_PREFIX_PATH=${AWS_DEPS_INSTALL_DIR}
3230
-DCMAKE_INSTALL_PREFIX=${AWS_DEPS_INSTALL_DIR}
3331
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
3432
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@@ -45,7 +43,6 @@ else()
4543
BUILD_IN_SOURCE 0
4644
UPDATE_COMMAND ""
4745
CMAKE_ARGS
48-
-DCMAKE_PREFIX_PATH=${AWS_DEPS_INSTALL_DIR}
4946
-DCMAKE_INSTALL_PREFIX=${AWS_DEPS_INSTALL_DIR}
5047
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
5148
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}

codebuild/common-windows.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

22
mkdir build
33
cd build
4-
cmake %* -DBUILD_DEPS=ON -DCMAKE_BUILD_TYPE="Release" ../ || goto error
4+
5+
REM Building deps to %TEMP% to avoid max path length errors during build
6+
cmake %* -DBUILD_DEPS=ON -DAWS_DEPS_BUILD_DIR="%TEMP%" -DCMAKE_BUILD_TYPE="Release" ../ || goto error
57
msbuild.exe aws-crt-cpp.vcxproj /p:Configuration=Release || goto error
68
msbuild.exe tests/aws-crt-cpp-tests.vcxproj /p:Configuration=Release
79
ctest -V || goto error

include/aws/crt/StlAllocator.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* permissions and limitations under the License.
1515
*/
1616

17-
#include <assert.h>
1817
#include <memory>
1918

2019
#include <aws/common/common.h>
@@ -48,13 +47,13 @@ namespace Aws
4847
typename Base::pointer allocate(size_type n, const void *hint = nullptr)
4948
{
5049
(void)hint;
51-
assert(g_allocator);
50+
AWS_ASSERT(g_allocator);
5251
return reinterpret_cast<typename Base::pointer>(aws_mem_acquire(g_allocator, n * sizeof(T)));
5352
}
5453

5554
void deallocate(typename Base::pointer p, size_type)
5655
{
57-
assert(g_allocator);
56+
AWS_ASSERT(g_allocator);
5857
aws_mem_release(g_allocator, p);
5958
}
6059
};

include/aws/crt/Types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ namespace Aws
6767

6868
AWS_CRT_CPP_API Allocator *DefaultAllocator() noexcept;
6969
AWS_CRT_CPP_API ByteBuf ByteBufFromCString(const char *str) noexcept;
70-
AWS_CRT_CPP_API ByteBuf ByteBufFromArray(const uint8_t *array, size_t len) noexcept;
70+
AWS_CRT_CPP_API ByteBuf ByteBufFromEmptyArray(const uint8_t *array, size_t len) noexcept;
71+
AWS_CRT_CPP_API ByteBuf ByteBufFromArray(const uint8_t *array, size_t capacity) noexcept;
7172
AWS_CRT_CPP_API ByteBuf ByteBufNewCopy(Allocator *alloc, const uint8_t *array, size_t len);
7273
AWS_CRT_CPP_API void ByteBufDelete(ByteBuf &);
7374

samples/mqtt_pub_sub/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set(CMAKE_C_FLAGS_DEBUGOPT "")
1515

1616
#set warnings
1717
if (MSVC)
18-
target_compile_options(${PUB_SUB_PROJECT_NAME} PRIVATE /W4 /WX)
18+
target_compile_options(${PUB_SUB_PROJECT_NAME} PRIVATE /W4 /WX /wd4068)
1919
else ()
2020
target_compile_options(${PUB_SUB_PROJECT_NAME} PRIVATE -Wall -Wno-long-long -pedantic -Werror)
2121
endif ()

source/Api.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace Aws
3535
g_allocator = allocator;
3636
Io::InitTlsStaticState(allocator);
3737
aws_http_library_init(allocator);
38+
aws_mqtt_library_init(allocator);
3839

3940
cJSON_Hooks hooks;
4041
hooks.malloc_fn = s_cJSONAlloc;
@@ -45,6 +46,7 @@ namespace Aws
4546
static void s_cleanUpApi()
4647
{
4748
g_allocator = nullptr;
49+
aws_mqtt_library_clean_up();
4850
aws_http_library_clean_up();
4951
Io::CleanUpTlsStaticState();
5052
}
@@ -59,7 +61,6 @@ namespace Aws
5961
{
6062
aws_load_error_strings();
6163
aws_io_load_error_strings();
62-
aws_mqtt_load_error_strings();
6364
}
6465

6566
const char *ErrorDebugString(int error) noexcept { return aws_error_debug_str(error); }

source/JsonObject.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ namespace Aws
359359

360360
String JsonView::GetString(const char *key) const
361361
{
362-
assert(m_value);
362+
AWS_ASSERT(m_value);
363363
auto item = cJSON_GetObjectItemCaseSensitive(m_value, key);
364364
auto str = cJSON_GetStringValue(item);
365365
return str != nullptr ? str : "";
@@ -379,31 +379,31 @@ namespace Aws
379379

380380
bool JsonView::GetBool(const char *key) const
381381
{
382-
assert(m_value);
382+
AWS_ASSERT(m_value);
383383
auto item = cJSON_GetObjectItemCaseSensitive(m_value, key);
384-
assert(item);
384+
AWS_ASSERT(item);
385385
return item->valueint != 0;
386386
}
387387

388388
bool JsonView::AsBool() const
389389
{
390-
assert(cJSON_IsBool(m_value));
390+
AWS_ASSERT(cJSON_IsBool(m_value));
391391
return cJSON_IsTrue(m_value) != 0;
392392
}
393393

394394
int JsonView::GetInteger(const String &key) const { return GetInteger(key.c_str()); }
395395

396396
int JsonView::GetInteger(const char *key) const
397397
{
398-
assert(m_value);
398+
AWS_ASSERT(m_value);
399399
auto item = cJSON_GetObjectItemCaseSensitive(m_value, key);
400-
assert(item);
400+
AWS_ASSERT(item);
401401
return item->valueint;
402402
}
403403

404404
int JsonView::AsInteger() const
405405
{
406-
assert(cJSON_IsNumber(m_value)); // can be double or value larger than int_max, but at least not UB
406+
AWS_ASSERT(cJSON_IsNumber(m_value)); // can be double or value larger than int_max, but at least not UB
407407
return m_value->valueint;
408408
}
409409

@@ -413,31 +413,31 @@ namespace Aws
413413

414414
int64_t JsonView::AsInt64() const
415415
{
416-
assert(cJSON_IsNumber(m_value));
416+
AWS_ASSERT(cJSON_IsNumber(m_value));
417417
return static_cast<int64_t>(m_value->valuedouble);
418418
}
419419

420420
double JsonView::GetDouble(const String &key) const { return GetDouble(key.c_str()); }
421421

422422
double JsonView::GetDouble(const char *key) const
423423
{
424-
assert(m_value);
424+
AWS_ASSERT(m_value);
425425
auto item = cJSON_GetObjectItemCaseSensitive(m_value, key);
426-
assert(item);
426+
AWS_ASSERT(item);
427427
return item->valuedouble;
428428
}
429429

430430
double JsonView::AsDouble() const
431431
{
432-
assert(cJSON_IsNumber(m_value));
432+
AWS_ASSERT(cJSON_IsNumber(m_value));
433433
return m_value->valuedouble;
434434
}
435435

436436
JsonView JsonView::GetJsonObject(const String &key) const { return GetJsonObject(key.c_str()); }
437437

438438
JsonView JsonView::GetJsonObject(const char *key) const
439439
{
440-
assert(m_value);
440+
AWS_ASSERT(m_value);
441441
auto item = cJSON_GetObjectItemCaseSensitive(m_value, key);
442442
return item;
443443
}
@@ -446,24 +446,24 @@ namespace Aws
446446

447447
JsonObject JsonView::GetJsonObjectCopy(const char *key) const
448448
{
449-
assert(m_value);
449+
AWS_ASSERT(m_value);
450450
/* force a deep copy */
451451
return JsonObject(cJSON_GetObjectItemCaseSensitive(m_value, key));
452452
}
453453

454454
JsonView JsonView::AsObject() const
455455
{
456-
assert(cJSON_IsObject(m_value));
456+
AWS_ASSERT(cJSON_IsObject(m_value));
457457
return m_value;
458458
}
459459

460460
Vector<JsonView> JsonView::GetArray(const String &key) const { return GetArray(key.c_str()); }
461461

462462
Vector<JsonView> JsonView::GetArray(const char *key) const
463463
{
464-
assert(m_value);
464+
AWS_ASSERT(m_value);
465465
auto array = cJSON_GetObjectItemCaseSensitive(m_value, key);
466-
assert(cJSON_IsArray(array));
466+
AWS_ASSERT(cJSON_IsArray(array));
467467
Vector<JsonView> returnArray(static_cast<size_t>(cJSON_GetArraySize(array)));
468468

469469
auto element = array->child;
@@ -477,7 +477,7 @@ namespace Aws
477477

478478
Vector<JsonView> JsonView::AsArray() const
479479
{
480-
assert(cJSON_IsArray(m_value));
480+
AWS_ASSERT(cJSON_IsArray(m_value));
481481
Vector<JsonView> returnArray(static_cast<size_t>(cJSON_GetArraySize(m_value)));
482482

483483
auto element = m_value->child;

source/Types.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ namespace Aws
2424

2525
ByteBuf ByteBufFromCString(const char *str) noexcept { return aws_byte_buf_from_c_str(str); }
2626

27-
ByteBuf ByteBufFromArray(const uint8_t *array, size_t len) noexcept
27+
ByteBuf ByteBufFromEmptyArray(const uint8_t *array, size_t len) noexcept
2828
{
29-
return aws_byte_buf_from_array(array, len);
29+
return aws_byte_buf_from_empty_array(array, len);
30+
}
31+
32+
ByteBuf ByteBufFromArray(const uint8_t *array, size_t capacity) noexcept
33+
{
34+
return aws_byte_buf_from_array(array, capacity);
3035
}
3136

3237
ByteBuf ByteBufNewCopy(Allocator *alloc, const uint8_t *array, size_t len)

source/UUID.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ namespace Aws
5050
String uuidStr;
5151
uuidStr.reserve(AWS_UUID_STR_LEN);
5252

53-
auto outBuf = ByteBufFromArray(reinterpret_cast<const uint8_t *>(uuidStr.data()), uuidStr.capacity());
54-
outBuf.len = 0;
53+
auto outBuf = ByteBufFromEmptyArray(reinterpret_cast<const uint8_t *>(uuidStr.data()), uuidStr.capacity());
5554
aws_uuid_to_str(&m_uuid, &outBuf);
5655
return uuidStr;
5756
}

source/http/HttpConnection.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ namespace Aws
9797

9898
bool HttpClientConnection::CreateConnection(const HttpClientConnectionOptions &connectionOptions) noexcept
9999
{
100-
assert(connectionOptions.onConnectionSetup);
101-
assert(connectionOptions.onConnectionShutdown);
102-
assert(connectionOptions.socketOptions);
100+
AWS_ASSERT(connectionOptions.onConnectionSetup);
101+
AWS_ASSERT(connectionOptions.onConnectionShutdown);
102+
AWS_ASSERT(connectionOptions.socketOptions);
103103

104104
auto *callbackData =
105105
New<ConnectionCallbackData>(connectionOptions.allocator, connectionOptions.allocator);
@@ -162,8 +162,8 @@ namespace Aws
162162
std::shared_ptr<HttpClientStream> HttpClientConnection::NewClientStream(
163163
const HttpRequestOptions &requestOptions) noexcept
164164
{
165-
assert(requestOptions.onIncomingHeaders);
166-
assert(requestOptions.onStreamComplete);
165+
AWS_ASSERT(requestOptions.onIncomingHeaders);
166+
AWS_ASSERT(requestOptions.onStreamComplete);
167167

168168
aws_http_request_options options;
169169
AWS_ZERO_STRUCT(options);

0 commit comments

Comments
 (0)