From 9a93b61f674ab21c995dac263d823a4f91c7b2ef Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Wed, 3 Jun 2020 20:16:30 -0400 Subject: [PATCH] [stdlib][cmake] OpenBSD target requires -lpthread. Like FreeBSD, OpenBSD needs -lpthread for a target link. This is necessary to get the swift-reflection-test to link and build correctly. --- stdlib/cmake/modules/AddSwiftStdlib.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/cmake/modules/AddSwiftStdlib.cmake b/stdlib/cmake/modules/AddSwiftStdlib.cmake index 05123d1d8e127..f94c5e641a9e3 100644 --- a/stdlib/cmake/modules/AddSwiftStdlib.cmake +++ b/stdlib/cmake/modules/AddSwiftStdlib.cmake @@ -351,6 +351,8 @@ function(_add_target_variant_link_flags) list(APPEND link_libraries "pthread" "dl") elseif("${LFLAGS_SDK}" STREQUAL "FREEBSD") list(APPEND link_libraries "pthread") + elseif("${LFLAGS_SDK}" STREQUAL "OPENBSD") + list(APPEND link_libraries "pthread") elseif("${LFLAGS_SDK}" STREQUAL "CYGWIN") # No extra libraries required. elseif("${LFLAGS_SDK}" STREQUAL "WINDOWS")