减少依赖影响范围 (#4039)
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run

See #4034
This commit is contained in:
Xiaofeng Wang 2024-11-25 11:22:29 +08:00 committed by GitHub
parent 326b475beb
commit 06ff8461c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 9 deletions

View File

@ -463,15 +463,6 @@ if(ENABLE_VIDEOSTACK)
endif ()
endif ()
if(NOT PCAP_FOUND AND ENABLE_TESTS)
find_package(PCAP QUIET)
if(PCAP_FOUND)
include_directories(SYSTEM ${PCAP_INCLUDE_DIRS})
list(APPEND LINK_LIBRARIES ${PCAP_LIBRARIES})
message(STATUS "found library: ${PCAP_LIBRARIES}")
endif()
endif()
# ----------------------------------------------------------------------------
# Solution folders:
# ----------------------------------------------------------------------------

View File

@ -23,6 +23,8 @@
aux_source_directory(. TEST_SRC_LIST)
find_package(PCAP QUIET)
foreach(TEST_SRC ${TEST_SRC_LIST})
get_filename_component(TEST_EXE_NAME ${TEST_SRC} NAME_WE)
@ -59,3 +61,8 @@ foreach(TEST_SRC ${TEST_SRC_LIST})
target_link_libraries(${TEST_EXE_NAME} ${MK_LINK_LIBRARIES})
endif()
endforeach()
if(TARGET test_rtp_pcap)
target_include_directories(test_rtp_pcap SYSTEM PRIVATE ${PCAP_INCLUDE_DIRS})
target_link_libraries(test_rtp_pcap ${PCAP_LIBRARIES})
endif()