Skip to content

Commit 9685342

Browse files
authored
CMake Fixes (#584)
* Generated code format pass * Pin clang-format * Stop doing aws_use_package on projects internal to the SDK
1 parent a8a131a commit 9685342

File tree

8 files changed

+216
-221
lines changed

8 files changed

+216
-221
lines changed

.github/workflows/lint.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
uses: actions/checkout@v1
1717

1818
- name: clang-format lint
19-
uses: DoozyX/clang-format-lint-action@v0.3.1
19+
uses: DoozyX/clang-format-lint-action@v0.13
2020
with:
2121
# List of extensions to check
2222
extensions: cpp,h
23+
clangFormatVersion: 11.1.0

devicedefender/CMakeLists.txt

+3-7
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,11 @@ target_include_directories(IotDeviceDefender-cpp PUBLIC
9999
if (BUILD_DEPS)
100100
if (NOT IS_SUBDIRECTORY_INCLUDE)
101101
aws_use_package(aws-crt-cpp)
102-
endif()
103-
aws_use_package(aws-c-iot)
104-
endif()
105-
106-
if (BUILD_TESTING)
107-
aws_use_package(IotDeviceCommon-cpp)
102+
aws_use_package(aws-c-iot)
103+
endif()
108104
endif()
109105

110-
target_link_libraries(IotDeviceDefender-cpp ${DEP_AWS_LIBS})
106+
target_link_libraries(IotDeviceDefender-cpp IotDeviceCommon-cpp)
111107

112108
install(FILES ${AWS_IOTDEVICEDEFENDER_HEADERS} DESTINATION "include/aws/iotdevicedefender/" COMPONENT Development)
113109

eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h

+8-7
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ namespace Aws
416416
ResultType GetResultType() const noexcept { return m_responseType; }
417417

418418
private:
419-
union AWS_EVENTSTREAMRPC_API OperationResult {
419+
union AWS_EVENTSTREAMRPC_API OperationResult
420+
{
420421
OperationResult(Crt::ScopedResource<AbstractShapeBase> &&response) noexcept
421422
: m_response(std::move(response))
422423
{
@@ -445,12 +446,12 @@ namespace Aws
445446
{
446447
/* An interface shared by all operations for retrieving the response object given the model name. */
447448
public:
448-
virtual ExpectedResponseFactory GetInitialResponseFromModelName(const Crt::String &modelName) const
449-
noexcept = 0;
450-
virtual ExpectedResponseFactory GetStreamingResponseFromModelName(const Crt::String &modelName) const
451-
noexcept = 0;
452-
virtual ErrorResponseFactory GetOperationErrorFromModelName(const Crt::String &modelName) const
453-
noexcept = 0;
449+
virtual ExpectedResponseFactory GetInitialResponseFromModelName(
450+
const Crt::String &modelName) const noexcept = 0;
451+
virtual ExpectedResponseFactory GetStreamingResponseFromModelName(
452+
const Crt::String &modelName) const noexcept = 0;
453+
virtual ErrorResponseFactory GetOperationErrorFromModelName(
454+
const Crt::String &modelName) const noexcept = 0;
454455
};
455456

456457
class AWS_EVENTSTREAMRPC_API ServiceModel

eventstream_rpc/tests/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
2828
endif()
2929
endif()
3030
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
31+
3132
if (NOT CMAKE_CXX_STANDARD)
3233
set(CMAKE_CXX_STANDARD 11)
3334
endif()
@@ -40,8 +41,6 @@ file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC})
4041

4142
set(TEST_BINARY_NAME ${PROJECT_NAME}-tests)
4243

43-
aws_use_package(aws-crt-cpp)
44-
aws_use_package(EventstreamRpc-cpp)
4544
add_test_case(OperateWhileDisconnected)
4645
# The tests below can be commented out when an EchoRPC Server is running on 127.0.0.1:8033
4746
#add_test_case(EventStreamConnect)

eventstream_rpc/tests/EchoTestRpcModel.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,8 @@ namespace Awstest
10401040
return Aws::Crt::String("awstest#CauseServiceErrorResponse");
10411041
}
10421042

1043-
Aws::Crt::Optional<Aws::Crt::String> CauseServiceErrorOperationContext::GetStreamingResponseModelName() const
1044-
noexcept
1043+
Aws::Crt::Optional<Aws::Crt::String> CauseServiceErrorOperationContext::GetStreamingResponseModelName()
1044+
const noexcept
10451045
{
10461046
return Aws::Crt::Optional<Aws::Crt::String>();
10471047
}
@@ -1107,15 +1107,15 @@ namespace Awstest
11071107
}
11081108

11091109
Aws::Crt::ScopedResource<AbstractShapeBase> CauseStreamServiceToErrorOperationContext::
1110-
AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const
1111-
noexcept
1110+
AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator)
1111+
const noexcept
11121112
{
11131113
return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator);
11141114
}
11151115

11161116
Aws::Crt::ScopedResource<AbstractShapeBase> CauseStreamServiceToErrorOperationContext::
1117-
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const
1118-
noexcept
1117+
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator)
1118+
const noexcept
11191119
{
11201120
return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator);
11211121
}
@@ -1201,8 +1201,8 @@ namespace Awstest
12011201
}
12021202

12031203
Aws::Crt::ScopedResource<AbstractShapeBase> EchoStreamMessagesOperationContext::
1204-
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const
1205-
noexcept
1204+
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator)
1205+
const noexcept
12061206
{
12071207
return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator);
12081208
}
@@ -1217,8 +1217,8 @@ namespace Awstest
12171217
return Aws::Crt::String("awstest#EchoStreamingResponse");
12181218
}
12191219

1220-
Aws::Crt::Optional<Aws::Crt::String> EchoStreamMessagesOperationContext::GetStreamingResponseModelName() const
1221-
noexcept
1220+
Aws::Crt::Optional<Aws::Crt::String> EchoStreamMessagesOperationContext::GetStreamingResponseModelName()
1221+
const noexcept
12221222
{
12231223
return Aws::Crt::String("awstest#EchoStreamingMessage");
12241224
}

0 commit comments

Comments
 (0)