remove targets built from headers only (part II)
Summary:
Some versions of compilers, linkers and cmake doesn't support. Required to
support OSX build
MODIFY
quic/api/test/Mocks.h
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 {

MODIFY
quic/api/test/QuicTransportTest.cpp
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<uint64_t> offsets;

MODIFY
quic/client/test/CMakeLists.txt
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

MODIFY
quic/codec/test/CMakeLists.txt
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
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
-)
-
-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

MODIFY
quic/congestion_control/test/CMakeLists.txt
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
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
-)
-
-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}
)

MODIFY
quic/handshake/test/CMakeLists.txt
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
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
-)
-
-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}
)

MODIFY
quic/samples/CMakeLists.txt
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
- $<BUILD_INTERFACE:${QUIC_FBCODE_ROOT}>
- ${QUIC_EXTRA_INCLUDE_DIRECTORIES}
- $<INSTALL_INTERFACE:include/>
-)
-
-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}

MODIFY
quic/samples/echo/EchoClient.h
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]);

MODIFY
quic/samples/echo/EchoHandler.h
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]);
}

MODIFY
quic/server/test/CMakeLists.txt
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

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