From 4dd8efffcbd49db0e7a70f534c2f01bac74cd0ed Mon Sep 17 00:00:00 2001 From: Udip Pant Date: Fri, 3 May 2019 14:20:47 -0700 Subject: [PATCH] remove targets built from headers only (part II) Summary: Some versions of compilers, linkers and cmake doesn't support. Required to support OSX build Reviewed By: afrind Differential Revision: D15204709 fbshipit-source-id: a9cbb5a59a0df0fa82838eb38a78a22e619db4ec --- quic/api/test/Mocks.h | 7 +--- quic/api/test/QuicTransportTest.cpp | 4 +- quic/client/test/CMakeLists.txt | 1 - quic/codec/test/CMakeLists.txt | 24 ----------- quic/congestion_control/test/CMakeLists.txt | 21 ---------- quic/handshake/test/CMakeLists.txt | 17 -------- quic/samples/CMakeLists.txt | 44 ++++----------------- quic/samples/echo/EchoClient.h | 2 +- quic/samples/echo/EchoHandler.h | 2 +- quic/server/test/CMakeLists.txt | 2 +- 10 files changed, 14 insertions(+), 110 deletions(-) diff --git a/quic/api/test/Mocks.h b/quic/api/test/Mocks.h index 01b32915b..844a87400 100644 --- a/quic/api/test/Mocks.h +++ b/quic/api/test/Mocks.h @@ -129,13 +129,10 @@ class MockConnectionCallback : public QuicSocket::ConnectionCallback { class MockDeliveryCallback : public QuicSocket::DeliveryCallback { public: ~MockDeliveryCallback() override = default; - GMOCK_METHOD3_( - , - , - , + MOCK_METHOD3( onDeliveryAck, void(StreamId, uint64_t, std::chrono::microseconds)); - GMOCK_METHOD2_(, , , onCanceled, void(StreamId, size_t)); + MOCK_METHOD2(onCanceled, void(StreamId, uint64_t)); }; class MockDataExpiredCallback : public QuicSocket::DataExpiredCallback { diff --git a/quic/api/test/QuicTransportTest.cpp b/quic/api/test/QuicTransportTest.cpp index 29593152c..878247e2f 100644 --- a/quic/api/test/QuicTransportTest.cpp +++ b/quic/api/test/QuicTransportTest.cpp @@ -161,7 +161,7 @@ class TransportClosingDeliveryCallback : public QuicSocket::DeliveryCallback { } } - void onCanceled(StreamId, size_t) override { + void onCanceled(StreamId, uint64_t) override { transport_->close(folly::none); } @@ -280,7 +280,7 @@ void verifyCorrectness( const folly::IOBuf& expected, bool finExpected = false, bool writeAll = true) { - size_t endOffset = 0; + uint64_t endOffset = 0; size_t totalLen = 0; bool finSet = false; std::vector offsets; diff --git a/quic/client/test/CMakeLists.txt b/quic/client/test/CMakeLists.txt index 4c0f1a4b7..9d3c4f0d5 100644 --- a/quic/client/test/CMakeLists.txt +++ b/quic/client/test/CMakeLists.txt @@ -15,7 +15,6 @@ quic_add_test(TARGET QuicClientTransportTest ${LIBGMOCK_LIBRARIES} mvfst_client mvfst_codec_types - mvfst_echohandler mvfst_handshake mvfst_server mvfst_test_utils diff --git a/quic/codec/test/CMakeLists.txt b/quic/codec/test/CMakeLists.txt index 6e898713a..8b6d97953 100644 --- a/quic/codec/test/CMakeLists.txt +++ b/quic/codec/test/CMakeLists.txt @@ -7,28 +7,6 @@ if(NOT BUILD_TESTS) return() endif() -add_library(mvfst_mock_codec STATIC - Mocks.h -) - -target_include_directories( - mvfst_mock_codec PUBLIC - $ -) - -add_dependencies( - mvfst_mock_codec - mvfst_codec_pktbuilder - mvfst_test_utils -) - -target_link_libraries( - mvfst_mock_codec PUBLIC - Folly::folly - mvfst_codec_pktbuilder - mvfst_test_utils -) - quic_add_test(TARGET QuicHeaderCodecTest SOURCES QuicHeaderCodecTest.cpp @@ -60,7 +38,6 @@ quic_add_test(TARGET QuicWriteCodecTest mvfst_codec_decode mvfst_codec_types mvfst_exception - mvfst_mock_codec mvfst_test_utils ${LIBGTEST_LIBRARY} ) @@ -128,7 +105,6 @@ quic_add_test(TARGET QuicPacketBuilderTest mvfst_codec_pktrebuilder mvfst_codec_types mvfst_handshake - mvfst_mock_codec mvfst_server mvfst_state_functions mvfst_state_machine diff --git a/quic/congestion_control/test/CMakeLists.txt b/quic/congestion_control/test/CMakeLists.txt index 12768aedc..b84280406 100644 --- a/quic/congestion_control/test/CMakeLists.txt +++ b/quic/congestion_control/test/CMakeLists.txt @@ -7,26 +7,6 @@ if(NOT BUILD_TESTS) return() endif() -add_library(mvfst_cubic_test_utils STATIC - TestingCubic.h -) - -target_include_directories( - mvfst_cubic_test_utils PUBLIC - $ -) - -add_dependencies( - mvfst_cubic_test_utils - mvfst_cc_algo -) - -target_link_libraries( - mvfst_cubic_test_utils PUBLIC - Folly::folly - mvfst_cc_algo -) - quic_add_test(TARGET CongestionControllerTests SOURCES CongestionControlFunctionsTest.cpp @@ -40,7 +20,6 @@ quic_add_test(TARGET CongestionControllerTests DEPENDS Folly::folly mvfst_cc_algo - mvfst_cubic_test_utils mvfst_test_utils ${LIBGTEST_LIBRARY} ) diff --git a/quic/handshake/test/CMakeLists.txt b/quic/handshake/test/CMakeLists.txt index 259a32cff..9400279ad 100644 --- a/quic/handshake/test/CMakeLists.txt +++ b/quic/handshake/test/CMakeLists.txt @@ -7,22 +7,6 @@ if(NOT BUILD_TESTS) return() endif() -add_library(quic_mock_handshake STATIC - Mocks.h -) - -target_include_directories( - quic_mock_handshake PUBLIC - $ -) - -target_link_libraries( - quic_mock_handshake PUBLIC - Folly::folly - ${LIBGMOCK_LIBRARIES} - ${LIBGTEST_LIBRARY} -) - quic_add_test(TARGET TransportParametersTest SOURCES TransportParametersTest.cpp @@ -40,7 +24,6 @@ quic_add_test(TARGET HandshakeLayerTest Folly::folly mvfst_codec_types mvfst_handshake - quic_mock_handshake mvfst_test_utils ${LIBGTEST_LIBRARY} ) diff --git a/quic/samples/CMakeLists.txt b/quic/samples/CMakeLists.txt index 2a39151f4..8d3e0e799 100644 --- a/quic/samples/CMakeLists.txt +++ b/quic/samples/CMakeLists.txt @@ -7,42 +7,6 @@ if(NOT BUILD_TESTS) return() endif() -add_library( - mvfst_echohandler STATIC - echo/EchoClient.h - echo/EchoHandler.h - echo/EchoServer.h -) - -target_include_directories( - mvfst_echohandler PUBLIC - $ - ${QUIC_EXTRA_INCLUDE_DIRECTORIES} - $ -) - -target_compile_options( - mvfst_echohandler - PRIVATE - ${_QUIC_COMMON_COMPILE_OPTIONS} -) - -target_link_libraries( - mvfst_echohandler PUBLIC - Folly::folly - fizz::fizz - mvfst_transport - mvfst_client - mvfst_test_utils - mvfst_server - ${LIBGTEST_LIBRARY} -) - -install( - TARGETS mvfst_echohandler - DESTINATION lib -) - file( GLOB_RECURSE QUIC_API_HEADERS_TOINSTALL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} @@ -55,9 +19,15 @@ foreach(header ${QUIC_API_HEADERS_TOINSTALL}) endforeach() add_executable(echo echo/main.cpp) + +target_compile_options( + echo + PRIVATE + ${_QUIC_COMMON_COMPILE_OPTIONS} +) + target_link_libraries( echo PUBLIC - mvfst_echohandler mvfst_test_utils ${GFLAGS_LIBRARIES} ${LIBGMOCK_LIBRARIES} diff --git a/quic/samples/echo/EchoClient.h b/quic/samples/echo/EchoClient.h index 0318eae10..fe14b8d84 100644 --- a/quic/samples/echo/EchoClient.h +++ b/quic/samples/echo/EchoClient.h @@ -81,7 +81,7 @@ class EchoClient : public quic::QuicSocket::ConnectionCallback, void onStreamWriteReady( quic::StreamId id, - size_t maxToSend) noexcept override { + uint64_t maxToSend) noexcept override { LOG(INFO) << "EchoClient socket is write ready with maxToSend=" << maxToSend; sendMessage(id, pendingOutput_[id]); diff --git a/quic/samples/echo/EchoHandler.h b/quic/samples/echo/EchoHandler.h index 876c8d1f7..c3d66c311 100644 --- a/quic/samples/echo/EchoHandler.h +++ b/quic/samples/echo/EchoHandler.h @@ -160,7 +160,7 @@ class EchoHandler : public quic::QuicSocket::ConnectionCallback, void onStreamWriteReady( quic::StreamId id, - size_t maxToSend) noexcept override { + uint64_t maxToSend) noexcept override { LOG(INFO) << "socket is write ready with maxToSend=" << maxToSend; echo(id, input_[id]); } diff --git a/quic/server/test/CMakeLists.txt b/quic/server/test/CMakeLists.txt index 8c8888f8e..88b54ce96 100644 --- a/quic/server/test/CMakeLists.txt +++ b/quic/server/test/CMakeLists.txt @@ -15,7 +15,7 @@ quic_add_test(TARGET QuicServerTest Folly::folly mvfst_codec mvfst_codec_types - mvfst_echohandler + mvfst_mock_socket mvfst_server mvfst_test_utils mvfst_transport