@@ -28,7 +28,7 @@ let terminfoLibraries: [LinkerSetting] = {
28
28
if !useTerminfo {
29
29
return [ ]
30
30
}
31
- #if os(FreeBSD)
31
+ #if os(FreeBSD) || os(OpenBSD)
32
32
return [ . linkedLibrary( " ncurses " ) ]
33
33
#else
34
34
return [ . linkedLibrary( " ncurses " , . when( platforms: [ . linux, . macOS] ) ) ]
@@ -335,18 +335,7 @@ package.targets.first { $0.name == "llbuildBasic" }?.linkerSettings = [
335
335
// FIXME: when the SupportedPlatforms availability directive is updated and
336
336
// the platform port is in sync with this directive, these conditions can
337
337
// be folded up with .when(platforms:_) clauses.
338
- #if os(OpenBSD)
339
- if let target = package . targets. first ( where: { $0. name == " llbuildCore " } ) {
340
- target. cSettings = [ . unsafeFlags( [ " -I/usr/local/include " ] ) ]
341
- target. linkerSettings = [
342
- . linkedLibrary( " sqlite3 " ) ,
343
- . unsafeFlags( [ " -L/usr/local/lib " ] )
344
- ]
345
- }
346
- #elseif os(FreeBSD)
347
- if let target = package . targets. first ( where: { $0. name == " llvmSupport " } ) {
348
- target. linkerSettings = [ " execinfo " , " m " , " pthread " , " ncurses " ] . map { . linkedLibrary( $0) }
349
- }
338
+ #if os(FreeBSD) || os(OpenBSD)
350
339
package . targets. filter ( { $0. name == " llbuildCore " || $0. name == " llbuildCoreTests " } ) . forEach {
351
340
$0. cSettings = [ . unsafeFlags( [ " -I/usr/local/include " ] ) ]
352
341
$0. linkerSettings = [
@@ -355,6 +344,15 @@ package.targets.filter({ $0.name == "llbuildCore" || $0.name == "llbuildCoreTest
355
344
]
356
345
357
346
}
347
+ #endif
348
+ #if os(OpenBSD)
349
+ if let target = package . targets. first ( where: { $0. name == " llvmSupport " } ) {
350
+ target. linkerSettings = [ " execinfo " , " ncurses " ] . map { . linkedLibrary( $0) }
351
+ }
352
+ #elseif os(FreeBSD)
353
+ if let target = package . targets. first ( where: { $0. name == " llvmSupport " } ) {
354
+ target. linkerSettings = [ " execinfo " , " m " , " pthread " , " ncurses " ] . map { . linkedLibrary( $0) }
355
+ }
358
356
package . targets. filter ( { $0. name == " llbuild " || $0. name == " swift-build-tool " } ) . forEach {
359
357
$0. linkerSettings = [ . linkedLibrary( " dl " ) , . linkedLibrary( " pthread " ) ]
360
358
}
0 commit comments