Stop consuming fizz via ExternalProject
Summary:
After changing fizz to export test headers and lib, we do not need to pull in
fizz as an ExternalProject anymore. This simplifies and fixes a lot of build
issues
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -27,6 +27,7 @@ find_package(Boost 1.62
context
)
find_package(folly REQUIRED)
+find_package(Fizz REQUIRED)
find_package(Glog REQUIRED)
find_package(Threads)
@@ -74,7 +75,7 @@ list(APPEND
-Wnon-virtual-dtor
)
-include(BuildFizz)
+SET(LIBFIZZ_LIBRARY fizz::fizz)
if(BUILD_TESTS)
enable_testing()
include(QuicTest)

MODIFY
build_helper.sh
build_helper.sh
@@ -68,9 +68,11 @@ mkdir -p "$MVFST_BUILD_DIR"
if [ -z "${INSTALL_PREFIX-}" ]; then
FOLLY_INSTALL_DIR=$DEPS_DIR
+ FIZZ_INSTALL_DIR=$DEPS_DIR
MVFST_INSTALL_DIR=$BWD
else
FOLLY_INSTALL_DIR=$INSTALL_PREFIX
+ FIZZ_INSTALL_DIR=$INSTALL_PREFIX
MVFST_INSTALL_DIR=$INSTALL_PREFIX
fi
@@ -187,6 +189,28 @@ function setup_folly() {
cd "$BWD" || exit
}
+function setup_fizz() {
+ FIZZ_DIR=$DEPS_DIR/fizz
+ FIZZ_BUILD_DIR=$DEPS_DIR/fizz/build/
+ if [ ! -d "$FIZZ_DIR" ] ; then
+ echo -e "${COLOR_GREEN}[ INFO ] Cloning fizz repo ${COLOR_OFF}"
+ git clone https://github.com/facebookincubator/fizz "$FIZZ_DIR"
+ echo -e "${COLOR_GREEN}[ INFO ] install dependencies ${COLOR_OFF}"
+ fi
+ echo -e "${COLOR_GREEN}Building Fizz ${COLOR_OFF}"
+ mkdir -p "$FIZZ_BUILD_DIR"
+ cd "$FIZZ_BUILD_DIR" || exit
+ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DBUILD_TESTS=ON \
+ -DCMAKE_PREFIX_PATH="$FIZZ_INSTALL_DIR" \
+ -DCMAKE_INSTALL_PREFIX="$FIZZ_INSTALL_DIR" \
+ "$FIZZ_DIR/fizz"
+ make -j "$nproc"
+ make install
+ echo -e "${COLOR_GREEN}Fizz is installed ${COLOR_OFF}"
+ cd "$BWD" || exit
+}
+
function detect_platform() {
unameOut="$(uname -s)"
case "${unameOut}" in
@@ -199,6 +223,7 @@ function detect_platform() {
detect_platform
setup_folly
+setup_fizz
# build mvfst:
cd "$MVFST_BUILD_DIR" || exit

MODIFY
cmake/QuicTest.cmake
cmake/QuicTest.cmake
@@ -65,7 +65,7 @@ function(quic_add_test)
"${QUIC_FBCODE_ROOT}/quic/common/test/TestMain.cpp"
)
# make sure googletest and fizz are built first
- add_dependencies(${QUIC_TEST_TARGET} googletest ${FIZZ_TARGET})
+ add_dependencies(${QUIC_TEST_TARGET} googletest)
target_compile_options(
${QUIC_TEST_TARGET} PRIVATE
${_QUIC_BASE_COMPILE_OPTIONS}

MODIFY
quic/CMakeLists.txt
quic/CMakeLists.txt
@@ -54,11 +54,6 @@ target_compile_options(
${_QUIC_COMMON_COMPILE_OPTIONS}
)
-add_dependencies(
- mvfst_exception
- ${FIZZ_TARGET}
-)
-
target_link_libraries(
mvfst_exception PUBLIC
Folly::folly

MODIFY
quic/api/CMakeLists.txt
quic/api/CMakeLists.txt
@@ -27,7 +27,6 @@ target_compile_options(
add_dependencies(
mvfst_transport
- ${FIZZ_TARGET}
mvfst_cc_algo
mvfst_codec
mvfst_codec_pktbuilder

MODIFY
quic/common/test/CMakeLists.txt
quic/common/test/CMakeLists.txt
@@ -30,7 +30,6 @@ target_compile_options(
add_dependencies(
mvfst_test_utils
- ${FIZZ_TARGET}
mvfst_client
mvfst_codec_pktbuilder
mvfst_codec_types

MODIFY
quic/congestion_control/CMakeLists.txt
quic/congestion_control/CMakeLists.txt
@@ -27,7 +27,6 @@ target_compile_options(
add_dependencies(
mvfst_cc_algo
- ${FIZZ_TARGET}
mvfst_constants
mvfst_exception
mvfst_state_machine

MODIFY
quic/handshake/CMakeLists.txt
quic/handshake/CMakeLists.txt
@@ -25,7 +25,6 @@ target_compile_options(
add_dependencies(
mvfst_handshake
- ${FIZZ_TARGET}
mvfst_constants
mvfst_exception
mvfst_codec_types

MODIFY
quic/happyeyeballs/CMakeLists.txt
quic/happyeyeballs/CMakeLists.txt
@@ -23,7 +23,6 @@ target_compile_options(
add_dependencies(
mvfst_happyeyeballs
- ${FIZZ_TARGET}
mvfst_state_machine
)

MODIFY
quic/server/CMakeLists.txt
quic/server/CMakeLists.txt
@@ -31,7 +31,6 @@ target_compile_options(
add_dependencies(
mvfst_server
- ${FIZZ_TARGET}
mvfst_constants
mvfst_codec
mvfst_codec_types

Stop consuming fizz via ExternalProject

Summary:
After changing fizz to export test headers and lib, we do not need to pull in
fizz as an ExternalProject anymore. This simplifies and fixes a lot of build
issues

Reviewed By: yangchi

Differential Revision: D15930220

fbshipit-source-id: dcb01c46b8ade545047c20af2fc5245223afff99