Skip to content

Commit

Permalink
CMake Fixes (#584)
Browse files Browse the repository at this point in the history
* Generated code format pass
* Pin clang-format
* Stop doing aws_use_package on projects internal to the SDK
  • Loading branch information
bretambrose authored May 14, 2023
1 parent a8a131a commit 9685342
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 221 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
uses: actions/checkout@v1

- name: clang-format lint
uses: DoozyX/clang-format-lint-action@v0.3.1
uses: DoozyX/clang-format-lint-action@v0.13
with:
# List of extensions to check
extensions: cpp,h
clangFormatVersion: 11.1.0
10 changes: 3 additions & 7 deletions devicedefender/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,11 @@ target_include_directories(IotDeviceDefender-cpp PUBLIC
if (BUILD_DEPS)
if (NOT IS_SUBDIRECTORY_INCLUDE)
aws_use_package(aws-crt-cpp)
endif()
aws_use_package(aws-c-iot)
endif()

if (BUILD_TESTING)
aws_use_package(IotDeviceCommon-cpp)
aws_use_package(aws-c-iot)
endif()
endif()

target_link_libraries(IotDeviceDefender-cpp ${DEP_AWS_LIBS})
target_link_libraries(IotDeviceDefender-cpp IotDeviceCommon-cpp)

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

Expand Down
15 changes: 8 additions & 7 deletions eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ namespace Aws
ResultType GetResultType() const noexcept { return m_responseType; }

private:
union AWS_EVENTSTREAMRPC_API OperationResult {
union AWS_EVENTSTREAMRPC_API OperationResult
{
OperationResult(Crt::ScopedResource<AbstractShapeBase> &&response) noexcept
: m_response(std::move(response))
{
Expand Down Expand Up @@ -445,12 +446,12 @@ namespace Aws
{
/* An interface shared by all operations for retrieving the response object given the model name. */
public:
virtual ExpectedResponseFactory GetInitialResponseFromModelName(const Crt::String &modelName) const
noexcept = 0;
virtual ExpectedResponseFactory GetStreamingResponseFromModelName(const Crt::String &modelName) const
noexcept = 0;
virtual ErrorResponseFactory GetOperationErrorFromModelName(const Crt::String &modelName) const
noexcept = 0;
virtual ExpectedResponseFactory GetInitialResponseFromModelName(
const Crt::String &modelName) const noexcept = 0;
virtual ExpectedResponseFactory GetStreamingResponseFromModelName(
const Crt::String &modelName) const noexcept = 0;
virtual ErrorResponseFactory GetOperationErrorFromModelName(
const Crt::String &modelName) const noexcept = 0;
};

class AWS_EVENTSTREAMRPC_API ServiceModel
Expand Down
3 changes: 1 addition & 2 deletions eventstream_rpc/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
endif()
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")

if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
Expand All @@ -40,8 +41,6 @@ file(GLOB TESTS ${TEST_HDRS} ${TEST_SRC})

set(TEST_BINARY_NAME ${PROJECT_NAME}-tests)

aws_use_package(aws-crt-cpp)
aws_use_package(EventstreamRpc-cpp)
add_test_case(OperateWhileDisconnected)
# The tests below can be commented out when an EchoRPC Server is running on 127.0.0.1:8033
#add_test_case(EventStreamConnect)
Expand Down
20 changes: 10 additions & 10 deletions eventstream_rpc/tests/EchoTestRpcModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,8 @@ namespace Awstest
return Aws::Crt::String("awstest#CauseServiceErrorResponse");
}

Aws::Crt::Optional<Aws::Crt::String> CauseServiceErrorOperationContext::GetStreamingResponseModelName() const
noexcept
Aws::Crt::Optional<Aws::Crt::String> CauseServiceErrorOperationContext::GetStreamingResponseModelName()
const noexcept
{
return Aws::Crt::Optional<Aws::Crt::String>();
}
Expand Down Expand Up @@ -1107,15 +1107,15 @@ namespace Awstest
}

Aws::Crt::ScopedResource<AbstractShapeBase> CauseStreamServiceToErrorOperationContext::
AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const
noexcept
AllocateInitialResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator)
const noexcept
{
return EchoStreamingResponse::s_allocateFromPayload(stringView, allocator);
}

Aws::Crt::ScopedResource<AbstractShapeBase> CauseStreamServiceToErrorOperationContext::
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const
noexcept
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator)
const noexcept
{
return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator);
}
Expand Down Expand Up @@ -1201,8 +1201,8 @@ namespace Awstest
}

Aws::Crt::ScopedResource<AbstractShapeBase> EchoStreamMessagesOperationContext::
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator) const
noexcept
AllocateStreamingResponseFromPayload(Aws::Crt::StringView stringView, Aws::Crt::Allocator *allocator)
const noexcept
{
return EchoStreamingMessage::s_allocateFromPayload(stringView, allocator);
}
Expand All @@ -1217,8 +1217,8 @@ namespace Awstest
return Aws::Crt::String("awstest#EchoStreamingResponse");
}

Aws::Crt::Optional<Aws::Crt::String> EchoStreamMessagesOperationContext::GetStreamingResponseModelName() const
noexcept
Aws::Crt::Optional<Aws::Crt::String> EchoStreamMessagesOperationContext::GetStreamingResponseModelName()
const noexcept
{
return Aws::Crt::String("awstest#EchoStreamingMessage");
}
Expand Down
Loading

0 comments on commit 9685342

Please sign in to comment.