Skip to content

Commit 3f2965a

Browse files
committed
Fix macOS picotls CMake configure failure
1 parent e243d4c commit 3f2965a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ set(OPENMOQ_PICOQUIC_SOURCE_DIR "/media/mondain/terrorbyte/workspace/github/pico
1818

1919
set(OPENMOQ_HAS_PICOQUIC OFF)
2020

21+
function(openmoq_sanitize_target_link_directories target_name)
22+
if(NOT TARGET "${target_name}")
23+
return()
24+
endif()
25+
26+
foreach(property_name IN ITEMS INTERFACE_LINK_DIRECTORIES LINK_DIRECTORIES)
27+
get_target_property(property_value "${target_name}" "${property_name}")
28+
if(NOT property_value OR property_value STREQUAL "property_value-NOTFOUND")
29+
continue()
30+
endif()
31+
32+
set(filtered_value "${property_value}")
33+
list(FILTER filtered_value EXCLUDE REGEX "^\\($|^\\)$")
34+
set_target_properties("${target_name}" PROPERTIES "${property_name}" "${filtered_value}")
35+
endforeach()
36+
endfunction()
37+
2138
if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists.txt")
2239
set(OPENMOQ_PICOTLS_SOURCE_DIR "${OPENMOQ_PICOQUIC_SOURCE_DIR}/../picotls" CACHE PATH
2340
"Path to a picotls source checkout")
@@ -35,6 +52,10 @@ if(OPENMOQ_ENABLE_PICOQUIC AND EXISTS "${OPENMOQ_PICOQUIC_SOURCE_DIR}/CMakeLists
3552
set(BUILD_LOGLIB OFF CACHE BOOL "" FORCE)
3653
set(BUILD_LOGREADER OFF CACHE BOOL "" FORCE)
3754
add_subdirectory("${OPENMOQ_PICOQUIC_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/picoquic")
55+
# picotls currently injects literal "(" and ")" entries into its link
56+
# directories list when Brotli is discovered via pkg-config. CMake on
57+
# macOS rejects those malformed source-prefixed paths during generate.
58+
openmoq_sanitize_target_link_directories(picotls-core)
3859
set(OPENMOQ_HAS_PICOQUIC ON)
3960
else()
4061
message(STATUS "picoquic checkout found, but picotls source was not found; building without picoquic integration")

0 commit comments

Comments
 (0)