CMake: Adjust wsutil includes and linking.
Mark wsutil's includes SYSTEM PRIVATE. This exposed a lot of targets that were indirectly picking up include paths via the wsutil target, so add direct includes where needed. The G.722 and G.726 codecs were implicilty including tiffio.h; find it explicitly instead. Mark some of wsutil's libraries PRIVATE, but leave commonly-used ones PUBLIC. Ping #17477.
This commit is contained in:
parent
9ae60d8483
commit
ff60fcf92d
|
@ -78,7 +78,7 @@ if (ENABLE_LTO)
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
message(STATUS "LTO/IPO is enabled")
|
message(STATUS "LTO/IPO is enabled")
|
||||||
else()
|
else()
|
||||||
message(STATUS "LTO/IPO requested but it is not supported by the compiler: ${lto_output}")
|
message(STATUS "LTO/IPO requested but it is not supported by the compiler: ${lto_output}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "LTO/IPO is not enabled")
|
message(STATUS "LTO/IPO is not enabled")
|
||||||
|
@ -1248,6 +1248,8 @@ ws_find_package(NL ENABLE_NETLINK HAVE_LIBNL)
|
||||||
|
|
||||||
ws_find_package(SBC ENABLE_SBC HAVE_SBC)
|
ws_find_package(SBC ENABLE_SBC HAVE_SBC)
|
||||||
|
|
||||||
|
# SpanDSP codec
|
||||||
|
find_package(TIFF QUIET)
|
||||||
ws_find_package(SPANDSP ENABLE_SPANDSP HAVE_SPANDSP)
|
ws_find_package(SPANDSP ENABLE_SPANDSP HAVE_SPANDSP)
|
||||||
|
|
||||||
ws_find_package(BCG729 ENABLE_BCG729 HAVE_BCG729)
|
ws_find_package(BCG729 ENABLE_BCG729 HAVE_BCG729)
|
||||||
|
@ -1402,10 +1404,11 @@ endif()
|
||||||
# Platform-specific additional libraries.
|
# Platform-specific additional libraries.
|
||||||
#
|
#
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
set(WIN_COMCTL32_LIBRARY comctl32.lib)
|
||||||
|
set(WIN_IPHLPAPI_LIBRARY iphlpapi.lib)
|
||||||
set(WIN_PSAPI_LIBRARY psapi.lib)
|
set(WIN_PSAPI_LIBRARY psapi.lib)
|
||||||
set(WIN_WS2_32_LIBRARY ws2_32.lib)
|
|
||||||
set(WIN_COMCTL32_LIBRARY comctl32.lib )
|
|
||||||
set(WIN_VERSION_LIBRARY version.lib)
|
set(WIN_VERSION_LIBRARY version.lib)
|
||||||
|
set(WIN_WS2_32_LIBRARY ws2_32.lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
@ -2780,6 +2783,7 @@ if(BUILD_capinfos)
|
||||||
add_executable(capinfos ${capinfos_FILES})
|
add_executable(capinfos ${capinfos_FILES})
|
||||||
set_extra_executable_properties(capinfos "Executables")
|
set_extra_executable_properties(capinfos "Executables")
|
||||||
target_link_libraries(capinfos ${capinfos_LIBS})
|
target_link_libraries(capinfos ${capinfos_LIBS})
|
||||||
|
target_include_directories(capinfos SYSTEM PRIVATE ${GCRYPT_INCLUDE_DIRS})
|
||||||
install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -2820,6 +2824,7 @@ if(BUILD_editcap)
|
||||||
add_executable(editcap ${editcap_FILES})
|
add_executable(editcap ${editcap_FILES})
|
||||||
set_extra_executable_properties(editcap "Executables")
|
set_extra_executable_properties(editcap "Executables")
|
||||||
target_link_libraries(editcap ${editcap_LIBS})
|
target_link_libraries(editcap ${editcap_LIBS})
|
||||||
|
target_include_directories(editcap SYSTEM PRIVATE ${GCRYPT_INCLUDE_DIRS})
|
||||||
install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ target_link_libraries(caputils
|
||||||
$<$<BOOL:${PCAP_FOUND}>:pcap::pcap>
|
$<$<BOOL:${PCAP_FOUND}>:pcap::pcap>
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${NL_LIBRARIES}
|
${NL_LIBRARIES}
|
||||||
|
${WIN_IPHLPAPI_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(caputils SYSTEM
|
target_include_directories(caputils SYSTEM
|
||||||
|
@ -59,10 +60,6 @@ target_include_directories(caputils SYSTEM
|
||||||
${NL_INCLUDE_DIRS}
|
${NL_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
target_link_libraries(caputils PRIVATE "iphlpapi.lib")
|
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
set_target_properties(caputils PROPERTIES
|
set_target_properties(caputils PROPERTIES
|
||||||
LINK_FLAGS "${WS_LINK_FLAGS}"
|
LINK_FLAGS "${WS_LINK_FLAGS}"
|
||||||
FOLDER "Libs")
|
FOLDER "Libs")
|
||||||
|
|
|
@ -337,6 +337,7 @@ target_link_libraries(epan
|
||||||
${SMI_LIBRARIES}
|
${SMI_LIBRARIES}
|
||||||
${SNAPPY_LIBRARIES}
|
${SNAPPY_LIBRARIES}
|
||||||
${WIN_PSAPI_LIBRARY}
|
${WIN_PSAPI_LIBRARY}
|
||||||
|
${WIN_WS2_32_LIBRARY}
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
${ZSTD_LIBRARIES}
|
${ZSTD_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
@ -351,6 +352,7 @@ target_include_directories(epan
|
||||||
SYSTEM PRIVATE
|
SYSTEM PRIVATE
|
||||||
${BROTLI_INCLUDE_DIRS}
|
${BROTLI_INCLUDE_DIRS}
|
||||||
${CARES_INCLUDE_DIRS}
|
${CARES_INCLUDE_DIRS}
|
||||||
|
${GCRYPT_INCLUDE_DIRS}
|
||||||
${GLIB2_INCLUDE_DIRS}
|
${GLIB2_INCLUDE_DIRS}
|
||||||
${GNUTLS_INCLUDE_DIRS}
|
${GNUTLS_INCLUDE_DIRS}
|
||||||
${GTHREAD2_INCLUDE_DIRS}
|
${GTHREAD2_INCLUDE_DIRS}
|
||||||
|
|
|
@ -38,7 +38,11 @@ target_include_directories(g722 PRIVATE ${CMAKE_SOURCE_DIR}/codecs)
|
||||||
|
|
||||||
target_link_libraries(g722 wsutil ${SPANDSP_LIBRARIES})
|
target_link_libraries(g722 wsutil ${SPANDSP_LIBRARIES})
|
||||||
|
|
||||||
target_include_directories(g722 SYSTEM PRIVATE ${SPANDSP_INCLUDE_DIRS})
|
target_include_directories(g722
|
||||||
|
SYSTEM PRIVATE
|
||||||
|
${SPANDSP_INCLUDE_DIRS}
|
||||||
|
${TIFF_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
install_plugin(g722 codecs)
|
install_plugin(g722 codecs)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,11 @@ target_include_directories(g726 PRIVATE ${CMAKE_SOURCE_DIR}/codecs)
|
||||||
|
|
||||||
target_link_libraries(g726 wsutil ${SPANDSP_LIBRARIES})
|
target_link_libraries(g726 wsutil ${SPANDSP_LIBRARIES})
|
||||||
|
|
||||||
target_include_directories(g726 SYSTEM PRIVATE ${SPANDSP_INCLUDE_DIRS})
|
target_include_directories(g726
|
||||||
|
SYSTEM PRIVATE
|
||||||
|
${SPANDSP_INCLUDE_DIRS}
|
||||||
|
${TIFF_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
install_plugin(g726 codecs)
|
install_plugin(g726 codecs)
|
||||||
|
|
||||||
|
|
|
@ -80,10 +80,17 @@ set_source_files_properties(
|
||||||
|
|
||||||
add_library(ui STATIC ${UI_SRC})
|
add_library(ui STATIC ${UI_SRC})
|
||||||
|
|
||||||
target_link_libraries(ui wsutil caputils)
|
target_link_libraries(ui
|
||||||
|
|
||||||
target_include_directories(ui SYSTEM
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
caputils
|
||||||
|
wsutil
|
||||||
|
${GCRYPT_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(ui
|
||||||
|
SYSTEM PRIVATE
|
||||||
|
${GCRYPT_INCLUDE_DIRS}
|
||||||
|
${GNUTLS_INCLUDE_DIRS}
|
||||||
${WINSPARKLE_INCLUDE_DIRS}
|
${WINSPARKLE_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -264,23 +264,24 @@ if(MSVC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(wsutil
|
target_link_libraries(wsutil
|
||||||
|
# *Lots* of our targets that link with wsutil also link with
|
||||||
|
# GLib and GModule. Mark them PUBLIC so that dependent targets
|
||||||
|
# don't have to link them directly.
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_DL_LIBS}
|
${GLIB2_LIBRARIES}
|
||||||
${APPLE_CORE_FOUNDATION_LIBRARY}
|
${GMODULE2_LIBRARIES}
|
||||||
${GMODULE2_LIBRARIES}
|
PRIVATE
|
||||||
${GLIB2_LIBRARIES}
|
${APPLE_CORE_FOUNDATION_LIBRARY}
|
||||||
${GCRYPT_LIBRARIES}
|
${CMAKE_DL_LIBS}
|
||||||
${WIN_WS2_32_LIBRARY}
|
${GCRYPT_LIBRARIES}
|
||||||
${GNUTLS_LIBRARIES}
|
${GNUTLS_LIBRARIES}
|
||||||
${M_LIBRARIES}
|
${M_LIBRARIES}
|
||||||
|
${WIN_IPHLPAPI_LIBRARY}
|
||||||
|
${WIN_WS2_32_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
target_include_directories(wsutil
|
||||||
target_link_libraries(wsutil PRIVATE "iphlpapi.lib" "ws2_32.lib")
|
SYSTEM PRIVATE
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
target_include_directories(wsutil SYSTEM
|
|
||||||
PUBLIC
|
|
||||||
${GCRYPT_INCLUDE_DIRS}
|
${GCRYPT_INCLUDE_DIRS}
|
||||||
${GNUTLS_INCLUDE_DIRS}
|
${GNUTLS_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue