facebook / mvfst

An implementation of the QUIC transport protocol.
MIT License
1.5k stars 242 forks source link

Why so many cmake target ? #246

Closed dbaldassi closed 2 years ago

dbaldassi commented 2 years ago

Hi, I'm trying to build an executable linking to mvfst. I have an mvfst installation directory, created by the cmake installer. When linking to mvfst using cmake, I need somehow to add all the mvfst target, like this

target_link_libraries( echo PRIVATE mvfst::mvfst_constants mvfst::mvfst_exception mvfst::mvfst_transport mvfst::mvfst_client mvfst::mvfst_codec_types mvfst::mvfst_codec_decode mvfst::mvfst_codec_pktbuilder mvfst::mvfst_codec_pktrebuilder mvfst::mvfst_codec_packet_number_cipher mvfst::mvfst_codec mvfst::mvfst_looper mvfst::mvfst_buf_accessor mvfst::mvfst_bufutil mvfst::mvfst_socketutil mvfst::mvfst_transport_knobs mvfst::mvfst_cc_algo mvfst::mvfst_dsr_sender mvfst::mvfst_dsr_types mvfst::mvfst_dsr_frontend mvfst::mvfst_fizz_client mvfst::mvfst_fizz_handshake mvfst::mvfst_flowcontrol mvfst::mvfst_handshake mvfst::mvfst_happyeyeballs mvfst::mvfst_qlogger mvfst::mvfst_loss mvfst::mvfst_server mvfst::mvfst_server_state mvfst::mvfst_state_machine mvfst::mvfst_state_ack_handler mvfst::mvfst_state_datagram_handler mvfst::mvfst_state_stream_functions mvfst::mvfst_state_pacing_functions mvfst::mvfst_state_functions mvfst::mvfst_state_simple_frame_functions mvfst::mvfst_state_stream mvfst::mvfst_d6d_probe_raiser mvfst::mvfst_d6d_state_functions mvfst::mvfst_d6d_types )

However, the mvfst-config.cmake file says that :

# This module exports the following target:
#    mvfst::mvfst

So, I assumed that mvfst::mvfst is the one target to link them all, but this target does not exists.

jbeshay commented 2 years ago

There is no mvfst::mvfst target but you also don't have include all of these separate targets. You can see the hq command line tool in Proxygen as an example: https://github.com/facebook/proxygen/blob/main/proxygen/httpserver/CMakeLists.txt#L142