Skip to content

Commit

Permalink
[=] fix diff/compile err
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylsy committed Oct 24, 2024
1 parent b457115 commit 131ab46
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 24 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ option (XQC_COMPAT_DUPLICATE "qpack compat dup" OFF)
option (XQC_ENABLE_FEC "enable fec" OFF)
option (XQC_ENABLE_XOR "enable fec scheme xor" OFF)
option (XQC_ENABLE_RSC "enable fec scheme reed-solomon code" OFF)
option (XQC_ENABLE_PKM "enable fec scheme packet mask" OFF)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
Expand Down Expand Up @@ -114,7 +115,7 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -O0 -std=gnu11 -Wall ${CMAKE_C_FLAG

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_definitions(-DXQC_SYS_WINDOWS=1)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Zi")
set(CMAKE_C_FLAGS_OPTION " ")
endif()


Expand All @@ -137,7 +138,6 @@ if(XQC_PRINT_SECRET)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_PRINT_SECRET")
endif()


# compat with the stateless reset before version v1.6.0
if(XQC_COMPAT_GENERATE_SR_PKT)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_COMPAT_GENERATE_SR_PKT")
Expand Down Expand Up @@ -227,6 +227,7 @@ set(
"src/transport/scheduler/xqc_scheduler_minrtt.c"
"src/transport/scheduler/xqc_scheduler_common.c"
"src/transport/scheduler/xqc_scheduler_backup.c"
"src/transport/scheduler/xqc_scheduler_backup_fec.c"
"src/transport/scheduler/xqc_scheduler_rap.c"
)

Expand All @@ -238,6 +239,7 @@ if(XQC_ENABLE_MP_INTEROP)
)
endif()


# fec framework
set(
FEC_FRAMEWORK_SOURCE
Expand All @@ -262,6 +264,14 @@ if(XQC_ENABLE_RSC)
)
endif()

if(XQC_ENABLE_PKM)
set(
FEC_FRAMEWORK_SOURCE
${FEC_FRAMEWORK_SOURCE}
"src/transport/fec_schemes/xqc_packet_mask.c"
)
endif()

if(XQC_ENABLE_FEC)
set(
TRANSPORT_SOURCES
Expand Down Expand Up @@ -392,7 +402,6 @@ if(PLATFORM MATCHES "mac")
${SSL_LIB_PATH}
"-Wl"
-lpthread
-lstdc++
)
else()
target_link_libraries(
Expand Down
2 changes: 1 addition & 1 deletion CMakeOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ option(SSL_TYPE "Using BoringSSL" boringssl)
option(SSL_DYNAMIC "Use dynamic libssl" OFF)
option(XQC_ENABLE_TESTING "Enable Testing" OFF)
option(XQC_BUILD_SAMPLE "Build Sample" OFF)
option(GCOV "Test Coverage" OFF)
option(GCOV "Test Coverage" OFF)
28 changes: 24 additions & 4 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ if (XQC_ENABLE_EVENT_LOG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_ENABLE_EVENT_LOG ")
endif()

if (DISABLE_WARNINGS)
add_compile_options("-Wno-error")
endif ()
# sendmmsg
if(XQC_SUPPORT_SENDMMSG_BUILD)
add_definitions(-DXQC_SUPPORT_SENDMMSG)
endif()

if(ANDROID)
set(DYMAMIC_LINK_OPTION
Expand Down Expand Up @@ -197,6 +198,7 @@ set(
"src/transport/scheduler/xqc_scheduler_minrtt.c"
"src/transport/scheduler/xqc_scheduler_common.c"
"src/transport/scheduler/xqc_scheduler_backup.c"
"src/transport/scheduler/xqc_scheduler_backup_fec.c"
"src/transport/scheduler/xqc_scheduler_rap.c"
)

Expand Down Expand Up @@ -233,6 +235,14 @@ if(XQC_ENABLE_RSC)
)
endif()

if(XQC_ENABLE_PKM)
set(
FEC_FRAMEWORK_SOURCE
${FEC_FRAMEWORK_SOURCE}
"src/transport/fec_schemes/xqc_packet_mask.c"
)
endif()

if(XQC_ENABLE_FEC)
set(
TRANSPORT_SOURCES
Expand Down Expand Up @@ -329,7 +339,16 @@ if(XQC_ENABLE_UNLIMITED)
)
endif()


# add tunnel
if(XQC_ENABLE_TH3 OR XQC_ENABLE_TUNNEL)
set(
XQC_SOURCE
)
if(XQC_ENABLE_TNL_DG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXQC_ENABLE_TNL_DG ")
endif()
add_subdirectory(tunnel)
endif()

if (XQC_NO_SHARED)
set(XQC_BINARY_TYPE STATIC)
Expand All @@ -343,6 +362,7 @@ add_library(
${TLS_SOURCE}
${COMMON_SOURCES}
${CONGESTION_CONTROL_SOURCES}
${XQC_SOURCE}
)

add_dependencies(xquic xquic_global)
Expand Down
4 changes: 4 additions & 0 deletions scripts/xquic.lds
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ XQUIC_VERS_1.0 {
xqc_h3_request_send_body;
xqc_h3_request_recv_headers;
xqc_h3_request_recv_body;
xqc_h3_priority_init;
xqc_write_http_priority;
xqc_parse_http_priority;
xqc_h3_request_set_priority;
Expand All @@ -52,6 +53,7 @@ XQUIC_VERS_1.0 {
xqc_stream_send;
xqc_engine_packet_process;
xqc_engine_finish_recv;
xqc_engine_finish_send;
xqc_engine_recv_batch;
xqc_engine_main_logic;
xqc_engine_get_default_config;
Expand All @@ -68,6 +70,7 @@ XQUIC_VERS_1.0 {
xqc_minrtt_scheduler_cb;
xqc_interop_scheduler_cb;
xqc_backup_scheduler_cb;
xqc_backup_fec_scheduler_cb;
xqc_rap_scheduler_cb;
xqc_conn_is_ready_to_send_early_data;
xqc_h3_conn_send_ping;
Expand Down Expand Up @@ -124,6 +127,7 @@ XQUIC_VERS_1.0 {
xqc_stream_update_settings;
xqc_reed_solomon_code_cb;
xqc_xor_code_cb;
xqc_packet_mask_code_cb;
local:
*;
};
2 changes: 1 addition & 1 deletion scripts/xquic_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function do_compile() {
fi

#turn on Code Coverage
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_PRINT_SECRET=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DXQC_ENABLE_UNLIMITED=1 -DXQC_ENABLE_COPA=1 -DXQC_COMPAT_DUPLICATE=1 -DXQC_ENABLE_FEC=1 -DXQC_ENABLE_XOR=1 -DXQC_ENABLE_RSC=1 ..
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_PRINT_SECRET=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DXQC_ENABLE_UNLIMITED=1 -DXQC_ENABLE_COPA=1 -DXQC_COMPAT_DUPLICATE=1 ..
make -j

if [ $? -ne 0 ]; then
Expand Down
15 changes: 1 addition & 14 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ endif()
add_executable(test_server ${TEST_SERVER_SOURCES})
add_executable(test_client ${TEST_CLIENT_SOURCES})


# link libraries
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(APP_DEPEND_LIBS
Expand All @@ -59,21 +58,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
${LIBEVENT_LIBRARY}
-lm
CACHE STRING "xquic app depend libs")
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(APP_DEPEND_LIBS
xquic-static
${SSL_LIB_PATH}
${LIBEVENT_LIBRARY}
m
dl
pthread
CACHE STRING "xquic app depend libs")
else()
set(APP_DEPEND_LIBS
xquic-static
${SSL_LIB_PATH}
${LIBEVENT_LIBRARY}
stdc++
m
dl
pthread
Expand Down Expand Up @@ -103,7 +92,6 @@ if(HAVE_CUNIT)
${UNIT_TEST_DIR}/xqc_reno_test.c
${UNIT_TEST_DIR}/xqc_cubic_test.c
${UNIT_TEST_DIR}/xqc_stream_frame_test.c
${UNIT_TEST_DIR}/xqc_wakeup_pq_test.c
${UNIT_TEST_DIR}/xqc_process_frame_test.c
${UNIT_TEST_DIR}/xqc_tp_test.c
${UNIT_TEST_DIR}/xqc_tls_test.c
Expand All @@ -125,7 +113,7 @@ if(HAVE_CUNIT)
${UNIT_TEST_DIR}/xqc_h3_ext_test.c
)

if(XQC_ENABLE_FEC)
if(XQC_ENABLE_FEC AND XQC_ENABLE_PKM)
set(
test_SOURCES
${test_SOURCES}
Expand Down Expand Up @@ -156,7 +144,6 @@ if(HAVE_CUNIT)
xquic-static
${CUNIT_LIBRARIES}
${SSL_LIB_PATH}
stdc++
m
dl
pthread
Expand Down
2 changes: 1 addition & 1 deletion tests/unittest/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ main()
|| !CU_add_test(pSuite, "xqc_test_retry", xqc_test_retry)
|| !CU_add_test(pSuite, "xqc_test_receive_invalid_dgram", xqc_test_receive_invalid_dgram)
|| !CU_add_test(pSuite, "xqc_test_h3_ext_frame", xqc_test_h3_ext_frame)
#ifdef XQC_ENABLE_FEC
#if ( defined XQC_ENABLE_FEC ) && ( defined XQC_ENABLE_PKM )
|| !CU_add_test(pSuite, "xqc_test_galois_calculation", xqc_test_galois_calculation)
|| !CU_add_test(pSuite, "xqc_test_fec_scheme", xqc_test_fec_scheme)
|| !CU_add_test(pSuite, "xqc_test_fec", xqc_test_fec)
Expand Down

0 comments on commit 131ab46

Please sign in to comment.