Skip to content

Commit 8690cbe

Browse files
authored
Merge pull request #28 from vlovich/fix-osx-linkage
Fix osx linkage
2 parents 0a555e2 + 1375efc commit 8690cbe

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,22 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
229229
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
230230
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
231231
FIND_LIBRARY(SECURITY_LIBRARY Security)
232+
233+
try_compile(CMAKE_SYSTEM_IS_IOS ${CMAKE_CURRENT_BINARY_DIR}/is_ios
234+
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/is_ios.c
235+
OUTPUT_VARIABLE IOS_TEST)
236+
232237
set(
233238
BASE_ARCH_LIBRARIES
234239

235240
${COREFOUNDATION_LIBRARY}
236241
${COCOA_LIBRARY}
237242
)
243+
244+
if (NOT CMAKE_SYSTEM_IS_IOS)
245+
list(APPEND BASE_ARCH_LIBRARIES ${SECURITY_LIBRARY})
246+
endif()
247+
238248
set(
239249
BASE_ARCH_SOURCES
240250

@@ -456,6 +466,7 @@ add_library(
456466
src/third_party/zlib/gzread.c
457467
src/third_party/zlib/uncompr.c
458468
)
469+
target_link_libraries(quic ${BASE_ARCH_LIBRARIES} ssl crypto protobuf)
459470

460471
#add_executable(
461472
# test_quic_server

is_ios.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "src/build/build_config.h"
2+
3+
#if !defined(OS_IOS)
4+
#error "Not iOS"
5+
#endif
6+
7+
int main() {
8+
}

0 commit comments

Comments
 (0)