- u_async.c: process immediate_queue BEFORE epoll_wait in uasync_poll - stcp_link.c: defensive NULL etcp_conn/etcp_link in stcp_link_close - utun_instance.c: move stcp_server_list_destroy_all to Phase J (before ETCP), add deferred drain in both Phase J and L - stcp.h/c: STCP_HS_ENC_CLIENT 6→38, STCP_HS_ENC_SERVER 7→39, exchange ed25519_pubkey in both handshake directions - etcp_connections.c: copy peer_ed25519 from STCP to ETCP_CONN in etcp_link_enter_ready_tcp; guard link->etcp in tcp_link_close_cb - chat_sync.c: fix lk->conn NULL dereference for TCP links - test_stcp.c: update stcp_server_create/stcp_client_connect callsites - tools/chat_tcp_test: change transport udp→tcp
86 lines
2.9 KiB
CMake
86 lines
2.9 KiB
CMake
|
|
macro(zxing_add_package_stb)
|
|
if(STB_IMAGE_INCLUDE_DIR)
|
|
add_library(stb::stb INTERFACE IMPORTED)
|
|
target_include_directories(stb::stb INTERFACE ${STB_IMAGE_INCLUDE_DIR})
|
|
else()
|
|
unset (STB_FOUND CACHE)
|
|
|
|
if (ZXING_DEPENDENCIES STREQUAL "AUTO")
|
|
find_package(PkgConfig)
|
|
pkg_check_modules (STB IMPORTED_TARGET stb)
|
|
elseif (ZXING_DEPENDENCIES STREQUAL "LOCAL")
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules (STB REQUIRED IMPORTED_TARGET stb)
|
|
endif()
|
|
|
|
if (NOT STB_FOUND)
|
|
include(FetchContent)
|
|
FetchContent_Declare (stb
|
|
GIT_REPOSITORY https://github.com/nothings/stb.git)
|
|
FetchContent_MakeAvailable (stb)
|
|
add_library(stb::stb INTERFACE IMPORTED)
|
|
target_include_directories(stb::stb INTERFACE ${stb_SOURCE_DIR})
|
|
else()
|
|
add_library(stb::stb ALIAS PkgConfig::STB)
|
|
endif()
|
|
endif()
|
|
endmacro()
|
|
|
|
macro(zxing_add_package name depname git_repo git_rev)
|
|
unset(${name}_FOUND CACHE) # see https://github.com/zxing-cpp/zxing-cpp/commit/8db14eeead45e0f1961532f55061d5e4dd0f78be#commitcomment-66464026
|
|
|
|
if (ZXING_DEPENDENCIES STREQUAL "AUTO")
|
|
find_package (${name} CONFIG)
|
|
elseif (ZXING_DEPENDENCIES STREQUAL "LOCAL")
|
|
find_package (${name} REQUIRED CONFIG)
|
|
endif()
|
|
|
|
if (NOT ${name}_FOUND)
|
|
include(FetchContent)
|
|
|
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.28")
|
|
FetchContent_Declare(
|
|
${depname}
|
|
GIT_REPOSITORY ${git_repo}
|
|
GIT_TAG ${git_rev}
|
|
EXCLUDE_FROM_ALL
|
|
)
|
|
|
|
if (${depname} STREQUAL "googletest")
|
|
# Prevent overriding the parent project's compiler/linker settings on Windows
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
endif()
|
|
|
|
FetchContent_MakeAvailable(${depname})
|
|
else()
|
|
FetchContent_Declare(
|
|
${depname}
|
|
GIT_REPOSITORY ${git_repo}
|
|
GIT_TAG ${git_rev}
|
|
)
|
|
|
|
if (${depname} STREQUAL "googletest")
|
|
# Prevent overriding the parent project's compiler/linker settings on Windows
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
endif()
|
|
|
|
FetchContent_GetProperties(${depname})
|
|
if (NOT ${depname}_POPULATED)
|
|
FetchContent_Populate(${depname})
|
|
add_subdirectory(
|
|
${${depname}_SOURCE_DIR}
|
|
${${depname}_BINARY_DIR}
|
|
EXCLUDE_FROM_ALL
|
|
)
|
|
endif()
|
|
# set (${name}_POPULATED TRUE) # this is supposed to be done in MakeAvailable but it seems not to?!?
|
|
endif()
|
|
|
|
if (${depname} STREQUAL "WebP" AND NOT TARGET WebP::webp)
|
|
add_library(WebP::webp ALIAS webp)
|
|
endif()
|
|
|
|
endif()
|
|
endmacro()
|